id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,branch,changelog,apichanges,internalchanges
12916,TracError message cannot contain a div,Ryan J Ollos,Ryan J Ollos,"SpamFilter raises an error with a `div` wrapping a list.
{{{#!python
self.reject_handler.reject_content(
req, tag.div(
tag_('Submission rejected as potential spam %(message)s',
message=msg),
class_='message'))
}}}
This doesn't render correctly.
[[Image(Screen Shot 2017-09-13 at 17.17.12.png,100%)]]
{{{#!text/html
Trac Error
Submission rejected as potential spam
- BlogSpam says content is spam (IP previously blocked: Anchor text matches pattern: payday loan [20-ip.js])
}}}
It seems reasonable that the user raising the `TracError` would want to render content like a list in a `div`, so we probably shouldn't restrict to `p` elements.
One way to deal with this would be to look for the `message` class rather than a `p` element when deciding whether to wrap the error message with `p.message`:
{{{#!diff
diff --git a/trac/templates/error.html b/trac/templates/error.html
index a17078d17..1fb241c65 100644
--- a/trac/templates/error.html
+++ b/trac/templates/error.html
@@ -81,7 +81,7 @@ ${description_en if url else description}
$title
- $message
+ $message
$message
}}}",defect,closed,normal,1.2.3,general,,normal,fixed,,,,Fixed incorrect rendering of `TracError` message containing a `div`.,,