Incorrect HTML generated by HTMLExceptionFormatter
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zope 2 |
Fix Released
|
Undecided
|
Tres Seaver |
Bug Description
Currently HTMLExceptionFo
According to w3.org (http://
The P element represents a paragraph. It cannot contain block-level elements (including P itself).
In (http://
%block; block-like elements e.g. paragraphs and lists
Therefore <p> and <ul> tags are both block level. So a <p> tag cannot wrap around a <ul> tag.
So instead of the current code:
def getPrefix(self):
return '<p>Traceback (innermost last):\r\n<ul>'
def formatLastLine(
return '</ul>%s</p>' % self.escape(
To fix this we need the follow:
def getPrefix(self):
return '<p>Traceback (innermost last):</p>\r\n<ul>'
def formatLastLine(
return '</ul><p>%s</p>' % self.escape(
Basically a </p> is added before the open \r\n<ul> in getPrefix and <p> is added after </ul> in formatLastLine.
This fixes the html so it is correct.
Changed in zope2: | |
milestone: | none → 2.12.5 |
Changed in zope2: | |
milestone: | 2.12.5 → 2.12.6 |
Changed in zope2: | |
status: | Fix Committed → Fix Released |
Thanks very much for the patch. Applied to the Zope 2.12 branch:
http:// svn.zope. org/Zope/ branches/ 2.12/?rev= 112182& view=rev
and to the trunk:
http:// svn.zope. org/Zope/ trunk/? rev=112183& view=rev