Xmllint –c14n – | XMLLINT_INDENT=$’\t’ xmllint –encode UTF-8 –format –Ĭat $STDIN | xmllint –c14n – | XMLLINT_INDENT=$’\t’ xmllint –encode UTF-8 –format – (If you’re curious, the difference is that the long hypen before the options should be a double dash, the long hyphen after “c14n” should be single dash, and the single quotes need to be changed to simple straight quotes instead of curly quotes.) It took me a while to figure out what was happening, so I’ve reposted their commands below. UPDATED:: Updated for TextWrangler version 4.5.8.īoth epharion and Mitch’s commands will work for TextWrangler verson 4, however they are mangled by the automatic formatting.
UPDATED:: Added a post to format PHP code in TextWrangler. UPDATED:: Added UTF8 encoding, thanks Rolan. This is an interesting facility to extend an already great text editor, and I will be looking into more cool scripts that can hopefully lessen my daily annoyances.
It’s lightweight and it has pretty much all you need from a text editor.
My text editor of choice on the Mac is TextWrangler.