You can edit the tidy configuration in TextMate. Open the bundle editor and find Tidy in the HTML section.
I altered mine to this:
# BEWARE. Errors are suppressed. "${TM_TIDY:-tidy}" -f /dev/null -q --indent auto -utf8 -wrap 0 --wrap-attributes 0 --break-before-br 1 --clean y --word-2000 y --tab-size $TM_TAB_SIZE --indent-spaces $TM_TAB_SIZE|\ if [[ "$TM_SOFT_TABS" == "YES" ]]; then cat; else ruby -pe '
unless $in_pre tab_size = ENV["TM_TAB_SIZE"].to_i space, text = /( *)(.*)/m.match($_)[1..2] $_ = "\t" * (space.length / tab_size).floor + " " * (space.length % tab_size) + text end
$in_pre = true if(/<pre>/) $in_pre = false if(/</pre>/) ' fi
You can play with your own preferences to make it like you like it. The docu is: http://tidy.sourceforge.net/docs/quickref.html
Tidy is handy, but I haven't been able to make it work exactly like I like (HTML tidy or Perl tidy), but it's at least close.
I did check to see if your line would be broken up, and it was not.
tigercore wrote:
The HTML Tidy function used to tidy the code in this format:
<p>Paragraph Text here</p>
but not for some reasons its doing it like this:
<p> Some text here </p>
And putting everything on a new line. It's also changing the doctype from XHTML Transitional to XHTML Strict.
Anyone know why it's doing this? Is it a preference or somhing I have changed somewhere?
Also note from the docs: "doctype. ... If set to 'auto' (the default) Tidy will use an educated guess based upon the contents of the document. ..."
I, too, found it changing my doctype to XHTML Strict. Which I did *not* want happening. So I changed to "--doctype strict" to "-- doctype transitional.
Tidy also had the nasty habit of removing all space between the beginning of a comment and whatever was right before it. This completely messed up my plan to use comments that would be easily visible and could be visually scanned for.
See bug 953800 "-i unwraps comments."
Submitted May 14, 2004. Last comment by me, July 2, 2006. Still open :(
Even if the developers *did* fix it, tell me how you'd get a current version, with the fix in it! They apparently no longer provide the source code, and the pre compiled Mac version is dated July 5, 2007
The version on my Mac reports "HTML Tidy for Mac OS X released on 1st December 2004."
Macports offers one dated October 26, 2005.
eo
On Nov 22, 2007, at 9:56 PM, barrettclark wrote:
You can edit the tidy configuration in TextMate. Open the bundle editor and find Tidy in the HTML section.
I altered mine to this:
# BEWARE. Errors are suppressed. "${TM_TIDY:-tidy}" -f /dev/null -q --indent auto -utf8 -wrap 0 --wrap-attributes 0 --break-before-br 1 --clean y --word-2000 y -- tab-size $TM_TAB_SIZE --indent-spaces $TM_TAB_SIZE|\ if [[ "$TM_SOFT_TABS" == "YES" ]]; then cat; else ruby -pe '
unless $in_pre tab_size = ENV["TM_TAB_SIZE"].to_i space, text = /( *)(.*)/m.match($_)[1..2] $_ = "\t" * (space.length / tab_size).floor + " " * (space.length % tab_size) + text end
$in_pre = true if(/<pre>/) $in_pre = false if(/</pre>/) ' fi
You can play with your own preferences to make it like you like it. The docu is: http://tidy.sourceforge.net/docs/quickref.html
Tidy is handy, but I haven't been able to make it work exactly like I like (HTML tidy or Perl tidy), but it's at least close.
I did check to see if your line would be broken up, and it was not.
tigercore wrote:
The HTML Tidy function used to tidy the code in this format:
<p>Paragraph Text here</p>
but not for some reasons its doing it like this:
<p> Some text here </p>
And putting everything on a new line. It's also changing the doctype from XHTML Transitional to XHTML Strict.
Anyone know why it's doing this? Is it a preference or somhing I have changed somewhere?
-- View this message in context: http://www.nabble.com/HTML-Tidy- Weirdness-tf4771947.html#a13907232 Sent from the textmate users mailing list archive at Nabble.com.
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On Wed, Nov 28, 2007 at 08:53:08PM -0800, Eric O'Brien wrote:
[snip]
Even if the developers *did* fix it, tell me how you'd get a current version, with the fix in it! They apparently no longer provide the source code, and the pre compiled Mac version is dated July 5, 2007
The version on my Mac reports "HTML Tidy for Mac OS X released on 1st December 2004."
Macports offers one dated October 26, 2005.
eo
I hope macports will update the port soon.
For the time being I compiled the newest version from November 2007. You can download it here: http://ruderich.com/simon/downloads/tidy-2007-11-07.zip
Just copy it anywhere in your PATH variable, for example /usr/local/bin. I hope it works.
Simon