Skip to content

Highlighting for string interpolation and colons #62

adie opened this Issue Nov 11, 2011 · 3 comments

2 participants

adie commented Nov 11, 2011

Found some strange behavior of syntax highlighting. If I use string starting with colons inside the interpolated value, then highlighting thinks that there is no interpolation. Example:

"<div class='item'>#{$(this).find(':selected').text()}</div>"

I've played a bit and found that the highlighting breaks only when colons are at the beginning of word. These examples have proper highlighting:

"<div class='item'>#{$(this).find(':').text()}</div>"
"<div class='item'>#{$(this).find('sele:cted').text()}</div>"
adie commented Nov 11, 2011

Wow, that's only happens if there are single quotes on the same line before those string. So updating the examples:

'' + "<div class='item'>#{$(this).find(':selected').text()}</div>" # highlighting breaks
"" + "<div class='item'>#{$(this).find(':selected').text()}</div>" # ok
"<div class='item'>#{$(this).find(':selected').text()}</div>" # ok
kchmck commented Nov 11, 2011

Thanks for reporting this! I found the syntax causing the problem and I'm working on a fix.

kchmck commented Nov 15, 2011

Alright, finally pushed 74e2adc that should fix this.

@kchmck kchmck closed this Nov 27, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.