At 14:12 -0500 11/07/2010, Morbus Iff wrote:
> Linda <[email protected]> asked:
>> How do I prevent Tidy in BBEdit when I reflow a document from changing
>> all of my <i> tags to <em> and all of my <b> tags to <strong>?
>
>Tidy does have this option at the command-line level (logical-emphasis), but
>I don't think you can tweak BBEdit's implementation of Tidy to support it.
>What
>I'd do is create a new Text Factory that runs the Reflow Document command, and
>then two search and replaces to tweak the tags back to what you want.


As Morbus says, BBEdit's built-in Tidy commands are limited to the options
presented in their dialogs.

However, you can make use of the additional options offered by the
command-line 'tidy' tool by applying it as a shell filter. To do this:

Create a tidy config file ("tidyconfig.txt") containing your desired
options, then create a shell filter as follows:

====
#!/bin/sh
/usr/bin/tidy -f /dev/null -config /path/to/your/tidyconfig.txt "$1"
====

and save it into the "Unix Filters" folder of BBEdit's app support folder:

~/Library/Application Support/BBEdit/Unix Support/Unix Filters/

You can now apply this filter to the frontmost document on by selecting it
from the Unix Filters submenu of the Shebang (#!) menu.


[Please note that whatever options you set for 'tidy', you'll need to
redirect error output away from stderr, otherwise the combined output will
be directed to BBEdit's Unix Script Output window instead of replacing the
current document's contents.]


Regards,

 Patrick Woolsey
==
Bare Bones Software, Inc.                        <http://www.barebones.com>
P.O. Box 1048, Bedford, MA 01730-1048

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem, 
please email "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

Reply via email to