trouble using html tidy with template files

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


First: sorry for my bad english :)

If I parse template files, html tidy remove all tags beginning with {
for example:


<select name="country" size="1">
{section name=country loop=data}



<select name="country" size="1">

Only the "" is untouched, because html tidy take it for
a value not for a tag.
How can I teach html tidy to ignore text starting with { and ending with }?

Thanks for your help!

S. Gohres

Re: trouble using html tidy with template files

Quoted text here. Click to load it

Not possible.

If you want to use Tidy, run it on the output (X)HTML, not on the
template files.


Re: trouble using html tidy with template files

__/ [ Sebastian Gohres ] on Saturday 04 March 2006 18:12 \__

Quoted text here. Click to load it

Your only possibility, I suspect, would be to get Tidy from SourceForge,
change the source code, and then recompile. You are not using Tidy to
sanitise true (X)HTML in this case and I can't believe an option exists for
one among the many possible exceptions.

What, for example, if you wanted to "tidy" some PHP scripts? That would
require a different tool altogether -- one which descends onto files and
executes an actual program, in PHP.

I suggest you consider before/after copies of the file being tidy'ied and
merge after the code has been sanitised. This is by no means easy if the
files are large. It becomes tedious.

Hope it helps,


Roy S. Schestowitz      |    Download Othello:  |    SuSE Linux     |     PGP-Key: 0x74572E8E
 11:40am  up 5 days  7:18,  9 users,  load average: 0.12, 0.38, 0.50 - next generation of search paradigms

Site Timeline