Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sublime Text 2 HTML5 syntax highlight

Im using sublime to edit html5 docs. But when I started to do quote-free editing like:

<div id=asdf>

instead of

<div id="asdf">

its syntax highlight gone crazy.

enter image description here

Any ideas how to solve this? Is there other up to date parser for sublime?

ty

like image 490
zsitro Avatar asked Apr 04 '12 08:04

zsitro


1 Answers

This Sublime Text thread suggests a way to fix it: http://www.sublimetext.com/forum/viewtopic.php?f=3&t=8129

Open up your HTML.tmLanguage (in ~/.config/sublime-text-2/Packages/HTML) and look for this:

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

Change the first line to

<string>(?&lt;==|='|=")</string>

Your unquoted values won't be highlighted in the same way that quoted values are highlighted, but it will at least prevent the syntax highlighting from completely breaking.

like image 63
Cory Gagliardi Avatar answered Sep 29 '22 06:09

Cory Gagliardi