Hint tidy that br is always empty

Hi,

I'm using tidy to auto-correct (incorrect) XHTML text. The text is only
a part of the whole XHTML document, so there's no <html>, no <body> and
so on. Therefore I'm using the input-xml option. Now tidy corrects

Foo bar.<br>
Baz bbo.<br><br>

to

<br>Baz bbo.
<br></br></br>

Which I have two problems with:

1. The first text node is lost. I can get around this by wrapping the
string in <?xml version="1.0" encoding="UTF-8"?><a> and </a> and
removing that afterwards. With that I get:

Foo bar.
<br>Baz bbo.
<br></br></br>

2. Because <br> is an empty element in HTML its contents is not rendered
by the browser. How can I teach tidy that when it sees <br> to just make
that <br/>? How can I teach it XHTML semantics (while still allowing
arbitrary valid tags)?

Thanks

-- 
Markus Bertheau <twanger@bluetwanger.de>

Received on Monday, 15 November 2004 12:09:04 UTC