TextWrangler Mac is the indispensable multi-purpose text editor,Excellent built-in code highlighting,Also supports regular expression searches ...... summary,For developers,It is necessary manpower。
but,TextWrangler for XML Not so smart - and often long after the opening line!
Anyway,The solution is simple,We can write a script to TextWrangler。
First of all
TextWrangler open a new blank document (the default is actually),Enter the following script statements:
1 2 |
#!/bin/sh XMLLINT_INDENT=$'\t' xmllint --format --encode utf-8 - |
Save
save document,But the path there Press shift + command + g Go to open the dialog,enter ~/Library/Application Support/TextWrangler/Text Filters/ turn on。
And then named Tidy XML.sh Save it。
use
At last,TextWrangler using Open your xml file,Click Text →. Apply Text Filter →. Tidy XML You can!
Original article written by LogStudio:R0uter's Blog » Let TextWrangler key to optimize XML file format
Reproduced Please keep the source and description link:https://www.logcg.com/archives/1652.html