Text Filter for BBEdit 11 to reformat ("pretty print") XML using `tidy`

3,962 views
Skip to first unread message

TJ Luoma

unread,
Nov 12, 2014, 8:24:31 AM11/12/14
to BBEdit List
I have made a Text Filter for BBEdit which uses `tidy` to reformat XML.

It does not attempt to do anything other than clean it up.

You can find it at:

https://github.com/tjluoma/text-filters/raw/master/Tidy-XML.sh

It should also be easy to change any `tidy` argument that you wish to
use differently.

I am by no means a `tidy` expert, I have just found that these
settings work for me. I would welcome suggestions for possible
improvements.

(See https://github.com/tjluoma/text-filters if you need help figuring
out how to install Text Filters for BBEdit)

TjL

Michael Carlson

unread,
Dec 18, 2014, 2:00:36 PM12/18/14
to bbe...@googlegroups.com
Thank you for this tip!
I was relying on tidy for years in BBEdit to troubleshoot xml files i send and receive in other programs. When it went away I did some grep search/replace to breakdown the one-line file to something a bit easier to read, but it wasn't satisfying. 
I found your fix and it fits perfectly with my workflow.

Thanks,
Mike

Rich F

unread,
Dec 19, 2014, 5:12:19 PM12/19/14
to bbe...@googlegroups.com
Hi there.  I modified your script (thank you) for HTML, and I can't seem to get it loaded into BBEdit.

I've left it as Tidy_HTML.sh and did the chmod 755 * yet it doesn't show up.  BBEdit need a restart?  Am I doing something wrong?

Cheers

On Wednesday, November 12, 2014 8:24:31 AM UTC-5, TJ Luoma wrote:
I have made a Text Filter for BBEdit which uses `tidy` to reformat XML.

<snip>

Rich F

unread,
Dec 19, 2014, 5:37:20 PM12/19/14
to bbe...@googlegroups.com
Never mind.  I found the problem.  


On Wednesday, November 12, 2014 8:24:31 AM UTC-5, TJ Luoma wrote:

shlepper

unread,
Mar 11, 2015, 9:34:09 AM3/11/15
to bbe...@googlegroups.com
Thank you very much for this very nice stuff.
Hans
Reply all
Reply to author
Forward
0 new messages