Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML5 syntax highlighting supported in some text editor? Notepad++ maybe?

I'm trying to move to HTML5 on new projects, that don't require high cross-browser-ism. However, I can't find a way to add the HTML5 tags, such as header or aside, to "normal" tags within other html-tags, so they would be highlighted. Un-colored code really slows development down, so I have to stick with xhtml until this issue gets resolved.

I'm using Notepad++, so it would be great to fix this issue in it specifically. If that's out of range, I'd like to hear any other similar (light, compact) text-editor, which supports HTML5 better.

like image 934
Martti Laine Avatar asked Feb 16 '11 15:02

Martti Laine


People also ask

Does HTML5 work in notepad?

Yes of course! Notepad++ is a very good text editor, especially for web languages. You can also try Sublime Text 3, especially for JS, as it is very lightweight and elegant. For HTML5 you must try Brackets by Adobe and use its live preview feature.

Does Notepad ++ support HTML?

Notepad++ is a text editor that is optimized for programming languages, making it ideal for coding in languages like C++, Batch, and HTML.

Is Notepad ++ good for JavaScript?

Notepad++ is a free, open source Windows source code editor and Notepad replacement that does a decent job of editing JavaScript. It also supports about 50 other programming and markup languages.


1 Answers

One way I can think of is to modify %ProgramFiles%\Notepad++\langs.xml, but I don't know if that is going to get overwritten when you upgrade Notepad++. You'll want to back up that file regardless, just in case.

Find this chunk (simply searching for <Language name="html" will do):

        <Language name="html" ext="html htm shtml shtm xhtml" commentLine="" commentStart="&lt;!--" commentEnd="--&gt;">
            <Keywords name="instre1">...</Keywords>
        </Language>

Inside the <Keywords> element, add the HTML5 element names space-separated, making sure you don't type over the existing names inside, of course.

You may have to have elevated privileges in order to save the file, but when you save it and restart Notepad++, it'll recognize your added names as HTML identifiers.

like image 193
BoltClock Avatar answered Sep 29 '22 05:09

BoltClock