Question

I'm finding myself pasting in a tonne of code that is minified, i,e all on one line.

Rather than scanning through it manually and adding in linebreaks to make it readable, is there an option in Sublime to do it, or a plugin?

For example, I have this (although much longer):

<html><head><title>some title</title></head><body><div><span>some content</span></div></body></html>

And I want to end up with this, without spending half an hour pressing enter on my keyboard:

<html>
  <head>
    <title>some title</title>
  </head>
  <body>
    <div>
      <span>some content</span>
    </div>
  </body>
</html>
Was it helpful?

Solution

If you have the Package Manager installed in you can install the Tidy HTML package.

OTHER TIPS

Tidy HTML for Sublime Text 2

HTML-CSS-JS Prettify for Sublime Text 3

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top