For html files I could find this functionality under Tools
-> Filters
-> Tidy HTML
. Notice that you need HTML Tidy installed1. I personally prefer to also have the file auto-indented: Edit
-> Preferences
-> External filters
-> Tidy XML: |tidy -i|
.
Additionally, for xml files you can add a new "Tidy XML" label with corresponding command |tidy -xml -i|
.
1 In Gentoo: sudo emerge -v app-text/htmltidy
; in Debian, sudo apt-get install tidy
; in Fedora, I would guess sudo yum install tidy
?