2 Feb 2004 04:35
Re: html4css1.py/head/title/validator.w3.org
David Goodger <goodger <at> python.org>
2004-02-02 03:35:39 GMT
2004-02-02 03:35:39 GMT
Darek Suchojad wrote: > it's my first post here and I think > you're doing a great job guys, thanks for that! You're welcome! > However, yesterday I was a bit surprised that html > version of this liitle document > > *italic* > **bold** > > won't be validated > by http://validator.w3.org, after running > rst2html.py mydoc.txt > mydoc.html. > > The document doesn't have to be **that** small, > simply not having any header sufficies, and the problem > is - <title> element in <head> won't be generated. I implemented the solution in a different way, changing docutils.writers.html4css1.HTMLTranslator.visit_document to: def visit_document(self, node): self.body.append(self.starttag(node, 'div', CLASS='document')) # empty or untitled document? if not len(node) or not isinstance(node[0], nodes.title): # for XHTML conformance: self.head.insert(0, '<title />\n')(Continue reading)
.
Heh, will do!
RSS Feed