Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configuring HTML Tidy to indent tags and nothing else in Notepad++

All I want HTMLTidy to do is indent my HTML document's tags, but it currently also changes the doctype, adds an xmlns attribute to the html tag, changes <br /> tags, and probably does some other stuff.

How do I make it so that HTMLTidy in Notepad++ only performs indentation when I select TextFX → TextFX HTML Tidy → TiDy Clean Document-nowrap?

like image 898
Max Avatar asked Oct 15 '22 14:10

Max


2 Answers

There's a file called HTMLTIDY.CFG in <NPPInstallDir>plugins\Config\tidy that configures the Tidy operation. From what you said, I think all you'd have to do is remove (or comment out with ';') everything but the indent options, i.e.

indent: yes
indent-spaces: 2
like image 99
yalestar Avatar answered Oct 19 '22 17:10

yalestar


Yes, use the XML plugin for Notepad++. It has a "pretty print" feature that will probably work on HTML.

like image 27
djangofan Avatar answered Oct 19 '22 15:10

djangofan