Sublime Forum

HTML unquoted

#1

Hi, I’ve noticed that if my ID tags are unquoted, it breaks highlighting for the rest of the file, however if I unquote other attributes, syntax highlighting works.

id=section-a, broken -> grab.by/eKhu
name=section-a, works -> grab.by/eKhG

I’ve noticed this in the html.tmLanguage file, which I read as “look back for quote or double quote”, but I am stumped at what you’d change that to if you want to match nothing, or if this is even the appropriate thing to change (as I do not know exactly what I am doing)

			<string>(?&lt;='|")</string>
			<key>name</key>
			<string>meta.attribute-with-value.id.html</string>

Thanks for any help!

0 Likes

#2

Would code[/code] work? How does it know if it’s expecting a end quote later?

*Update: I tried it and it does seem to work, can anyone confirm it’s the correct way to go about it?

0 Likes

#3

I’m having the same issue - how did you go about editing the html.tmLanguage file?

Cheers,

0 Likes

#4

<key>end</key> <string>(?&lt;==|='|=")</string> <key>name</key> <string>meta.attribute-with-value.id.html</string>

Chris, sorry for the late reply. I changed my file directly to the above.

0 Likes

#5

This might be a better way to do it:

(?&lt;==('|")?)
0 Likes

#6

I got this question answered here:
stackoverflow.com/questions/1177 … on-mac-osx

0 Likes