Page 1 of 1


Posted: Sun Nov 15, 2009 10:11 pm
by BATMan_Phln
First of all, I searched the forum and got this...

The following words in your search query were ignored because they are too common words: html tidy.

...not much help there.

Anyway, is there a way to have HTML Tidy break at a tag instead of in the tag?

Wrap set at 80 (any other setting just changes which part wraps but it's still incorrect)
Current break:

<a href=""><font size="4" color=
"#00FF00"><strong>Email</strong></font></a> | <a href=
"Aircraft/index.htm"><font size="4" color=
"#00FF00"><strong>Projects</strong></font></a> | <a href=
"Products.htm"><font size="4" color=
"#00FF00"><strong>Products</strong></font></a> | <a href=
"AboutUs.htm"><font size="4" color="#00FF00"><strong>About

How I want it to look:

<a href="">
<font size="4" color="#00FF00"><strong>Email</strong></font></a> |
<a href="Aircraft/index.htm">
<font size="4" color="#00FF00"><strong>Projects</strong></font></a> |
<a href="Products.htm">
<font size="4" color="#00FF00"><strong>Products</strong></font></a> |
<a href="AboutUs.htm">
<font size="4" color="#00FF00"><strong>About Us</strong></font></a>

BTW, it's not my code so please don't criticize. I know it's crap. LOL

Thanks for the help,

Re: HTML Tidy

Posted: Mon Nov 16, 2009 8:55 am
by Albert Wiersch

I checked the HTML Tidy quick-ref page:

I didn't see any wrap options that will do what you want (look at the options beginning with "wrap"). :(

Re: HTML Tidy

Posted: Mon Nov 16, 2009 10:25 am
by BATMan_Phln
Well, I went through the settings and played with all of those. Nothing worked so I guess I'm stuck doing it manually. :cry: I was hoping someone knew of a back-end that will make it work.

Thanks for the reply! :)

Re: HTML Tidy

Posted: Mon Nov 16, 2009 2:11 pm
by MikeGale
Like you, I have on occasion needed to process other people's markup.

On big jobs I have found Tidy able to do a lot of the work, but it has limits. It used to conflate different settings into one. Making it impossible to make it do exactly what you want. (Last time I checked it still worked like that.)

After a rough clean up with tidy I found that a little work with regular expressions on multiple files can often just about finish the job. It pays to test your regular expressions first and save them in a library for re-use.

For a small job, page by page editing, maybe by hand, can be most productive.

When doing a big job, setting up a CSE batch increases productivity.

Re: HTML Tidy

Posted: Fri Jan 14, 2011 4:50 pm
by ormaaj
It's a little old and not so maintained. Also huge with lots of options. It's nice for transforming a big mess into something resembling (x)html so you can finish the job with sed / some editor.

If you happen to be a Vim user have a look at :h makeprg and :h equalprg for filtering a buffer through tidy. :%! can be handy too.