Opened 7 years ago
Last modified 7 years ago
#12916 closed defect
TracError message cannot contain a div — at Initial Version
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.2.3 |
Component: | general | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
SpamFilter raises an error with a div
wrapping a list.
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.
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
:
-
trac/templates/error.html
diff --git a/trac/templates/error.html b/trac/templates/error.html index a17078d17..1fb241c65 100644
a b ${description_en if url else description}</textarea> 81 81 <py:when test="'TracError'"> 82 82 <h1>$title</h1> 83 83 <py:choose test=""> 84 <p py:when="not find_element(message, tag='p')" class="message">$message</p>84 <p py:when="not find_element(message, cls='message')" class="message">$message</p> 85 85 <py:otherwise>$message</py:otherwise> 86 86 </py:choose> 87 87 </py:when>
Note:
See TracTickets
for help on using tickets.