0

I want to beautify HTML code as the following

<html><body><p>Here comes <i>a comma</i>, there should be no whitespace <b>before</b> it</p></body></html>

to an output like this:

<html>
 <body>
  <p>
   Here comes
   <i>
    a comma</i>,
   there should be no whitespace
   <b>
    before
   </b>
   it
  </p>
 </body>
</html>

I do not want the following:

<html>
 <body>
  <p>
   Here comes
   <i>
    a comma
   </i>
   , there should be no whitespace
   <b>
    before
   </b>
   it
  </p>
 </body>
</html>

which is on a source-code level perfectly formatted, but changes how the HTML page is displayed in the browser. It adds a whitespace between "comma" and ",".

So I need a HTML beautifier that can do this. Preferably for Windows, but if it's a web app or a Python script, a plug-in to some editor, etc. it's okay too.

| improve this question | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.