Closed h3xx closed 6 months ago
Describe the issue
A @ or % at the end of a double-quoted string is highlighted wrong.
@
%
It seems to highlight @ surrounded by whitespace correctly.
Perl won't interpolate @ or % when NOT followed by an identifier or variable:
# These print literal '@' characters print "@"; print "user @ host";
Which language seems to have the issue?
Are you using highlight or highlightAuto? Whichever one https://highlightjs.org/demo uses.
highlight
highlightAuto
Sample Code to Reproduce
print "@"; print 'highlighting for the rest of the file is broken'; # until " is encountered
- OR -
print "%"; print 'highlighting for the rest of the file is broken'; # until " is encountered
Expected behavior Expected to highlight the file as if the @ or % were any other character.
Additional context Tested on https://highlightjs.org/demo
Can you confirm the fix? Any other cases we need to cover here?
I added a test in my fork: d68f0814719d1b677deeb551b4a815ef7b13029c
It seems to pass given your changes.
Describe the issue
A
@
or%
at the end of a double-quoted string is highlighted wrong.It seems to highlight
@
surrounded by whitespace correctly.Perl won't interpolate
@
or%
when NOT followed by an identifier or variable:Which language seems to have the issue?
Are you using
highlight
orhighlightAuto
? Whichever one https://highlightjs.org/demo uses.Sample Code to Reproduce
- OR -
Expected behavior Expected to highlight the file as if the
@
or%
were any other character.Additional context Tested on https://highlightjs.org/demo