How to force soft-wrapping by tag attributes in TextWrangler

Keith Clarke keith.clarke at clarkeandclarke.co.uk
Sat Jun 11 11:26:19 EDT 2011


Hi folks,
I'm working with a web service that creates a lot of complex attributes within various HTML tags. So, I'm looking for a way to persuade TextWrangler to soft-wrap HTML text at the start of each tag's attributes, so that

<td class="something" id="something_else" onclick="another_thing" ... ... ondblclick="one_more_thing">

becomes

<td 
	class="something" 
	id="something_else" 
	onclick="another_thing" 
	...

	...
	ondblclick="one_more_thing">

I found this this UNIX Filter that makes a good start, by wrapping an OSX tidy service and forcing soft-wrapping by tag and then page width (the '200')...

/usr/bin/tidy -utf8 -asxhtml -indent -wrap 200 -quiet "$1" 2> /dev/null

However, I can't seem to get the syntax correct to wrap tag attributes from this guide to Tidy http://tidy.sourceforge.net/docs/quickref.html#wrap-attributes, as the following attempts clear the text view in TextWrangler.

/usr/bin/tidy -utf8 -asxhtml -indent -wrap-attributes="true" -wrap 200 -quiet "$1" 2> /dev/null

/usr/bin/tidy -utf8 -asxhtml -indent -wrap-attributes -wrap 200 -quiet "$1" 2> /dev/null

Any insights gratefully received.
Best,
Keith.. 



More information about the use-livecode mailing list