welovewordpress / SublimeHtmlTidy

Tidy, clean and prettify your HTML code with this plugin for Sublime Text 2
GNU General Public License v2.0
88 stars 15 forks source link

Only return body if I select the whole HTML when running tidy command #34

Closed longhua closed 10 years ago

longhua commented 10 years ago

I use default settings and the original HTML is as follow:

<!DOCTYPE html>
<html>
<head>
 <title>Title</title>
</head>
<body>
<h1>heading 1</h1>
<p>
paragraph 1
</p>
</body>
</html>

I select the whole document and run tidy command. Then I get the following text:

<h1>
    heading 1
</h1>
<p>
    paragraph 1
</p>

It only returns the content of HTML body.

welovewordpress commented 10 years ago

You're not supposed to select the whole document before calling Tidy - either select some HTML snippet, or don't select anything if you want the whole document to be processed.