Modify ↓
Opened 19 hours ago
#13875 new defect
Html sanitizer doesn't add missing closing tags
Reported by: | Jun Omae | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | next-stable-1.6.x |
Component: | wiki system | Version: | 1.4 |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
The html sanitizer adds missing closing tags in Trac 1.0.20, but doesn't in Trac 1.6. It can result that the output is not well-formed fragment.
See also: #13589
Trac 1.6
>>> import trac >>> trac.__version__ '1.6' >>> 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 ... <div> ... <p>foo</p> ... }}} ... """) Markup('<div>\n<p>foo</p>\n')
Trac 1.0.20
>>> import trac >>> trac.__version__ '1.0.20' >>> 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 ... <div> ... <p>foo</p> ... }}} ... """) <Markup u'<div>\n<p>foo</p>\n</div>'>
Attachments (0)
Note:
See TracTickets
for help on using tickets.