Use HTML Tidy to just indent HTML code?

后端 未结 6 1766
离开以前
离开以前 2020-12-13 10:03

Is it possible to use HTML Tidy to just indent HTML code?

Sample Code

6条回答
  •  长情又很酷
    2020-12-13 10:22

    To answer the poster's original question, using Tidy to just indent HTML code, here's what I use:

    tidy --indent auto --quiet yes --show-body-only auto --show-errors 0 --wrap 0 input.html

    input.html

    
    
    

    Output:

    No extra HTML code added. Errors are suppressed. To find out what each option does, it's best to refer to the official reference.

提交回复
热议问题