W3C home > Mailing lists > Public > html-tidy@w3.org > October to December 2004

Hint tidy that br is always empty

From: Markus Bertheau <twanger@bluetwanger.de>
Date: Mon, 15 Nov 2004 13:01:04 +0100
To: html-tidy@w3.org
Message-Id: <1100520064.3333.6.camel@dicaprio.akademie1.de>


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>


<br>Baz bbo.

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.

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)?


Markus Bertheau <twanger@bluetwanger.de>
Received on Monday, 15 November 2004 12:09:04 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:38:55 UTC