Modify ↓
Opened 3 hours ago
#13874 assigned defect
wbr tag is not listed in TracHTMLSanitizer.SAFE_TAGS and the sanitizer doesn't render well-formed fragment
Reported by: | Jun Omae | Owned by: | Jun Omae |
---|---|---|---|
Priority: | normal | Milestone: | 1.6.1 |
Component: | wiki system | Version: | 1.4 |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
The wbr
tag is defined in HTML5, but TracHTMLSanitizer
removes the tags.
Also, TracHTMLSanitizer
incorrectly removes closed tag of the parent element. As the result, it doesn't render well-formed fragment.
Trac 1.6
>>> import trac, jinja2 >>> trac.__version__, jinja2.__version__ ('1.6', '3.1.5') >>> from trac.test import EnvironmentStub, MockRequest >>> from trac.web.chrome import web_context >>> from trac.wiki.formatter import format_to_html >>> env = EnvironmentStub() >>> req = MockRequest(env) >>> context = web_context(req) >>> format_to_html(env, context, u'{{{#!html\n<div> foo <wbr /> bar </div>\n}}}\n') Markup('<div> foo ') >>> format_to_html(env, context, u'{{{#!html\n<div> foo <wbr> bar </div>\n}}}\n') Markup('<div> foo ')
Trac 1.0.20
>>> import trac, genshi >>> trac.__version__, genshi.__version__ ('1.0.20', '0.7.7') >>> format_to_html(env, context, u'{{{#!html\n<div> foo <wbr /> bar </div>\n}}}\n') <Markup u'<div> foo bar </div>\n'> >>> format_to_html(env, context, u'{{{#!html\n<div> foo <wbr> bar </div>\n}}}\n') <Markup u'<div> foo </div>\n'>
Attachments (0)
Note:
See TracTickets
for help on using tickets.