Discussion about HTML and XHTML related issues.
Rank 0 - Newcomer
Rank 0 - Newcomer
Posts: 8
Joined: Tue Jun 16, 2009 7:34 pm


Postby BATMan_Phln » Sun Nov 15, 2009 11:11 pm

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,

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 2821
Joined: Sat Dec 11, 2004 10:23 am
Location: Near Dallas, TX

Re: HTML Tidy

Postby Albert Wiersch » Mon Nov 16, 2009 9:55 am


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"). :(
Albert Wiersch

Rank 0 - Newcomer
Rank 0 - Newcomer
Posts: 8
Joined: Tue Jun 16, 2009 7:34 pm

Re: HTML Tidy

Postby BATMan_Phln » Mon Nov 16, 2009 11:25 am

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! :)

User avatar
Rank VI - Professional
Rank VI - Professional
Posts: 655
Joined: Mon Dec 13, 2004 2:50 pm
Location: Tannhauser Gate

Re: HTML Tidy

Postby MikeGale » Mon Nov 16, 2009 3:11 pm

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.

Rank I - Novice
Rank I - Novice
Posts: 10
Joined: Mon Nov 15, 2010 9:25 am

Re: HTML Tidy

Postby ormaaj » Fri Jan 14, 2011 5:50 pm

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.

Return to “HTML and XHTML”

Who is online

Users browsing this forum: No registered users and 1 guest