Sublime Forum

Highlighting character %

#1

Good morning.
How can I remove the highlighting to the “%” character in html?
Thank you.

0 Likes

#2

Isn’t a possible solution?

http://s12.postimg.org/e8hzrpg95/screenshot.jpg

0 Likes

#3

Are you talking about the ampersand or the percent symbol?
the ampersand is highlighted because it triggers invalid.illegal.bad-ampersand.html scope in HTML.tmLanguage, using unescaped ampersand (also for querystring in links) should be avoided as it’s formally an error in html.

0 Likes

#4

I said just the symbol “%”.
Is there a way to fix this thing?
It is an error in the html codece?

0 Likes

#5

Excuse me a lot. The character “&”…

0 Likes

#6

So i centered the point in my previews answer.
The & (ampersand), should be used escaped in html, even into link’s querystrings, so it’s better to write & instead of the simple &.
Although is commonly used unescaped, as a matter of fact it works in both ways, it’s a formal error in html specs not to use the html entity for it, and ST is doing well highlighting it.
This gives you 3 options:

  1. just ignore it (like i do),
  2. use & in your code,
  3. tweak/change html.tmlanguage

:smile:

0 Likes