HTML Tidy

Discussion about HTML and XHTML related issues.

HTML Tidy

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?

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

<a href="mailto:info@shakycoastaviation.com"><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>

How I want it to look:

<a href="mailto:info@shakycoastaviation.com">
<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,
B.A.T.Man
BATMan_Phln
Rank 0 - Newcomer
Rank 0 - Newcomer
 
Posts: 6
Joined: Tue Jun 16, 2009 7:34 pm

Re: HTML Tidy

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

Hello,

I checked the HTML Tidy quick-ref page:
http://tidy.sourceforge.net/docs/quickref.html

I didn't see any wrap options that will do what you want (look at the options beginning with "wrap"). :(
Image
Albert Wiersch
User avatar
Albert Wiersch
Site Admin
Site Admin
 
Posts: 2653
Joined: Sat Dec 11, 2004 10:23 am
Location: Near Dallas, TX

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! :)
BATMan_Phln
Rank 0 - Newcomer
Rank 0 - Newcomer
 
Posts: 6
Joined: Tue Jun 16, 2009 7:34 pm

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.
User avatar
MikeGale
Rank VI - Professional
Rank VI - Professional
 
Posts: 637
Joined: Mon Dec 13, 2004 2:50 pm
Location: Tannhauser Gate

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.
ormaaj
Rank I - Novice
Rank I - Novice
 
Posts: 10
Joined: Mon Nov 15, 2010 9:25 am


Return to HTML and XHTML

Who is online

Users browsing this forum: No registered users and 3 guests