Python Forum
single/double quote escapes codebox highlighter
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
single/double quote escapes codebox highlighter
#1
someone posted this...
    if s[0] == "'" and s[-1] == "'":
and i remember there was an issue regarding the string of the codebox escaping incorrectly. But i 1) cant find that thread and 2) dont remember if we fixed this issue or not?
Recommended Tutorials:
Reply
#2
I don't remember if we have looked at this or it has ever come up.
It's a rare case,usually it it's more code like this.
'a' and 'b'
1 and 2
'l' and '4'
'''c''' and '''d'''
'4' or '7'
# The rare case
'"' and '"'
'"' and '&'
So i don't know if digging into regex for this is worth it,can also mess up something else.
Reply
#3
I know we've talked about it before, but I can't find where it's mentioned specifically.  Lots of highlighter threads, though.

I think the issue is related to multiple different quote characters near each other, like the highlighter loses track of which one is the enclosing quote, or something, and ends up highlighting too much.  I also think it might be specifically related to single quotes.
Reply
#4
"'" and "'"
'"' and '"'
" ' " and " ' "
' " ' and ' " '
So it appears to only happen when you string a single or double quotation mark by itself.

I guess that would be a rare case of someone doing that. But it is surely annoying. I might be in agreement, that it might make it worse by tweaking the regex. But i also might think it might be worth trying to tweak if it happens more in the future.
Recommended Tutorials:
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  codebox usage help doc metulburr 0 1,649 Oct-31-2020, 12:12 PM
Last Post: metulburr
  quote and double post Skaperen 14 6,909 Oct-14-2018, 04:29 AM
Last Post: wavic
  Fast Quote button doesn't work syogun 2 2,952 Sep-04-2017, 03:57 PM
Last Post: syogun
  codebox borders metulburr 15 15,743 Nov-24-2016, 04:04 AM
Last Post: snippsat
  URL not showing properly in comments of codebox Larz60+ 4 5,478 Nov-05-2016, 04:23 PM
Last Post: Larz60+
  More codebox issues Mekire 26 19,467 Oct-13-2016, 05:20 PM
Last Post: wavic
  Syntax Highlighter Codebox Issues metulburr 38 27,888 Oct-06-2016, 01:06 AM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020