Modify ↓
Opened 4 weeks ago
Last modified 4 weeks 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)
Change History (2)
comment:1 by , 4 weeks ago
comment:2 by , 4 weeks ago
Hmm, still buggy….
>>> format_to_html(env, context, u"""{{{#!html ... <div>111<foo>222<foo>333</foo>444</foo>555</div> ... """) Markup('<div>111444</foo>555</div>\n') >>> >>> format_to_html(env, context, u"""{{{#!html ... <div>111<foo>222<bar>333</div> ... """) Markup('<div>111')
Note:
See TracTickets
for help on using tickets.
Proposed changes in [d8f45987e/jomae.git] (jomae.git@t13874).