#11009 closed defect (fixed)
Bold WikiFormatting leaking outside ticket body
Reported by: | Owned by: | Peter Suter | |
---|---|---|---|
Priority: | high | Milestone: | 0.12.6 |
Component: | wiki system | Version: | |
Severity: | major | Keywords: | formatter |
Cc: | andrewcmartin@…, Jun Omae | Branch: | |
Release Notes: |
Fix bad html produced when a binary markup tag (e.g. |
||
API Changes: | |||
Internal Changes: |
Description (last modified by )
Having the following text in a ticket will result in all subsequent ticket description, comments, and workflow text to default to a bold font weight. The WikiFormatting should not extend past the scope in which it is started.
*** * ***
Note there is one space on the second line.
I've verified this bug in Trac 0.12.3 and Trac 1.0.1dev-r11320
For a demo, see ticket:11009?version=4 (I had to "fix" the description, as this prevented making further changes, at least with Chrome, see comment:5). — cboos
Attachments (1)
Change History (14)
comment:1 by , 12 years ago
comment:3 by , 12 years ago
Description: | modified (diff) |
---|
comment:4 by , 12 years ago
Component: | rendering → wiki system |
---|---|
Keywords: | formatter added |
Milestone: | → topic-wikiengine |
Seems like a list item immediately followed by some opening tag is broken. Closing the list flushes all tags including the closing tag corresponding to the opening tag yet to be written. So this also affects e.g. ordered lists and italic text:
1. The list item //The closing tag that should follow this opening tag was flushed out when closing the list
results in:
<ol><li>The list item </em></li></ol></p> <em>The closing tag that should follow this opening tag was flushed out to close the list </p>
comment:5 by , 12 years ago
Description: | modified (diff) |
---|
Italic as well, of course, as still visible in ticket:11013?version=0.
And somehow this propagates to breaking the dynamic preview, and sometimes prevent updating the ticket (I couldn't save my change to #11013 until I fixed the formatting of the description, due to the "someone else modified the ticket in the meantime" error). I suppose it's simply due to the broken HTML structure we end up with.
Ah, and same thing here, now.
comment:6 by , 12 years ago
Description: | modified (diff) |
---|---|
Priority: | normal → high |
Severity: | normal → major |
follow-up: 8 comment:7 by , 11 years ago
Cc: | added |
---|
#11373 was closed as duplicate. Also, proposed changes can be found in log:jomae.git:ticket11009_0.12.6dev.
follow-up: 9 comment:8 by , 11 years ago
#11373 was closed as duplicate. Also, proposed changes can be found in log:jomae.git:ticket11009_0.12.6dev.
Could someone review the patch?
by , 11 years ago
Attachment: | T11009-list-wikiformat-leak.patch added |
---|
Close list before checking open tags.
follow-up: 11 comment:9 by , 11 years ago
Replying to jomae:
Could someone review the patch?
Looks almost good to me.
But I think _indirect_tag_handler
should first close any lists if needed and only then check if the tag is already open. Otherwise the following fails:
1. //italic in list //italic in paragraph
With your patch _indirect_tag_handler
:
- First checks if the
//
tag is open (yes) - Then closes the list (this flushes and closes the open
//
tag) - Attempts to close the
//
tag again (because the check in 1. said yes).
Fixing this actually simplifies the code. I added this testcase, the simplified _indirect_tag_handler
and a similar simplification of _bolditalic_formatter
to your code in the attached patch.
comment:10 by , 11 years ago
Milestone: | topic-wikiengine → 0.12.6 |
---|
comment:11 by , 11 years ago
Fixing this actually simplifies the code. I added this testcase, the simplified
_indirect_tag_handler
and a similar simplification of_bolditalic_formatter
to your code in the attached patch.
Thanks for reviewing. Your patch looks pretty good rather than my patch. Please commit!
comment:12 by , 11 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Committed in [12549] and merged in [12550-12551].
comment:13 by , 11 years ago
Owner: | set to |
---|
This comment does not have any bold WikiFormatting.