By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,837 Members | 1,842 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,837 IT Pros & Developers. It's quick & easy.

How to use tidy to "beautify" xhtml ?

P: n/a
Could you post some recommendation/advices which options should be used when
using tidy to beautify xhtml ?

It seems that "wrapped" xhtml produced by standards settings is not "liked" by
some search engines .

e.g. tidy inserted line breaks in attributes after opening "

.....<a href="
http://example.com/"> ...

[google parsed it with no problems]

BTW Can you recommend another free tool to beautify xhtml ?

URL(s):
http://tidy.sourceforge.net/

--
Andrzej [en:Andrew] Adam Filip an**@priv.onet.pl an**@xl.wp.pl
http://anfi.homeunix.net/ http://slashdot.org/~anfi
*Random Epigram* :
A country can be judged by the quality of its proverbs.
-- German Proverb

Jul 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Andrzej Adam Filip (Tue, 01 Jun 2004 20:34:00 +0000):

BTW Can you recommend another free tool to beautify xhtml ?


xmllint --format --html

Chris
--
Chris Huebsch www.hübsch-gemacht.de | TU Chemmnitz, Informatik, RNVS
GPG-Encrypted mail welcome! ID:7F2B4DBA | Str. d. Nationen 62, B204
Chemnitzer Linux-Tage 2005, 5.-6.März | D-09107 Chemnitz
http://www.tu-chemnitz.de/linux/tag/ | +49 371 531-1377, Fax -1803
Jul 20 '05 #2

P: n/a
Andrzej Adam Filip <an**@priv.onet.pl> writes:
It seems that "wrapped" xhtml produced by standards settings is not
"liked" by some search engines .

e.g. tidy inserted line breaks in attributes after opening "

....<a href="
http://example.com/"> ...

I have a ~/tidy.conf with the contents:

wrap: 0

and run tidy with:

tidy -i -m -config ~/tidy.conf file.xhtml. I don't like the wrapping
just because it makes nesting difficult.

My biggest problem with tidy is that I use www.clearsilver.net for a
templating system and it doesn't support that kind of tag markup <?cs
..... ?>
--
Chris Green <cm*@dok.org>
Fame may be fleeting but obscurity is forever.
Jul 20 '05 #3

P: n/a
Chris Green wrote:
Andrzej Adam Filip <an**@priv.onet.pl> writes:

It seems that "wrapped" xhtml produced by standards settings is not
"liked" by some search engines .

e.g. tidy inserted line breaks in attributes after opening "

....<a href="
http://example.com/"> ...
I have a ~/tidy.conf with the contents:

wrap: 0

and run tidy with:

tidy -i -m -config ~/tidy.conf file.xhtml. I don't like the wrapping
just because it makes nesting difficult.


I want to get wrapping :-(
I use wider than default "wrap space" (--wrap 120).

It seems that "--indent-attributes yes" fixed the problem.
My biggest problem with tidy is that I use www.clearsilver.net for a
templating system and it doesn't support that kind of tag markup <?cs
.... ?>


--
Andrzej [en:Andrew] Adam Filip an**@priv.onet.pl an**@xl.wp.pl
http://anfi.homeunix.net/ http://slashdot.org/~anfi
*Random Epigram* :
"Infidels in all ages have battled for the rights of man, and have at all times
been the fearless advocates of liberty and justice."
-- Robert Green Ingersoll

Jul 20 '05 #4

P: n/a
* Andrzej Adam Filip wrote in comp.text.xml:
Could you post some recommendation/advices which options should be used when
using tidy to beautify xhtml ?

It seems that "wrapped" xhtml produced by standards settings is not "liked" by
some search engines .

e.g. tidy inserted line breaks in attributes after opening "

....<a href="
http://example.com/"> ...


Are you certain it's not actually before the " as in

<a href=
"..."

?
Jul 20 '05 #5

P: n/a
Bjoern Hoehrmann wrote:
* Andrzej Adam Filip wrote in comp.text.xml:
Could you post some recommendation/advices which options should be used when
using tidy to beautify xhtml ?

It seems that "wrapped" xhtml produced by standards settings is not "liked" by
some search engines .

e.g. tidy inserted line breaks in attributes after opening "

....<a href="
http://example.com/"> ...

Are you certain it's not actually before the " as in

<a href=
"..."

?


You are right.

I was mislead by "Page Source" of Mozilla 1.6. The actual file was formatted
as you wrote. I have found it when trying to post "wrong format" extract from
the actual file.

I have accused tidy of another program "sins" :-(

--
Andrzej [en:Andrew] Adam Filip an**@priv.onet.pl an**@xl.wp.pl
http://anfi.homeunix.net/ http://slashdot.org/~anfi
*Random Epigram* :
A field held in common is always ravaged by bears.
-- Russian Proverb

Jul 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.