Opened 18 years ago
Closed 15 years ago
#3232 closed defect (fixed)
Wiki syntax should be enforced (for ticket comments)
Reported by: | Emmanuel Blot | Owned by: | Christian Boos |
---|---|---|---|
Priority: | high | Milestone: | 0.12 |
Component: | wiki system | Version: | devel |
Severity: | normal | Keywords: | parser |
Cc: | dserodio@…, ryano@… | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
When the wiki syntax is not valid (missing closing tag, for example: ''italic'
), Trac does not fix it up.
Although this is not a strong issue with Wiki pages that can be edited and fixed by human beings, it starts to become an issue with ticket comments: the missing wiki tag - which is translated to an XHTML missing tag - propagates across the whole ticket and may corrupt the whole page.
As ticket comments cannot be edited, the only current way to recover from such a simple user mistake is to tweak the SQL DB ;-(
IMHO, Trac should ensure that such an error does not propagate outside a comment, i.e. should always close any open tag along with the end of a comment.
It is worth noting that when post-commit hooks are used -such as the one from the /contrib
dir- the user may not even notice than "his" wiki syntax is not correct, as it is never rendered from his subversion client (commit message).
Attachments (1)
Change History (19)
by , 18 years ago
Attachment: | comment-missed-a-quote-char.png added |
---|
comment:1 by , 18 years ago
Can you post the exact comment which was causing this? I can't reproduce the issue.
comment:2 by , 18 years ago
Sure. From sqlite3:
sqlite> select * from ticket_change where ticket=670 and time=1149159330; 670|1149159330|souquiej|comment||(In [575]) Refs #670 * dyntest: ''sga:mdraw'' renamed to ''sga:drawm'' * dyntest: new ''sga:adrawm' command, exercised in drawbat.dtf
There are remaining comments after this one, but the display misbehaves starting after the missing "'
" char.
If it can help, the server runs [3320].
comment:3 by , 18 years ago
Milestone: | → 0.10 |
---|---|
Owner: | changed from | to
Ok, thanks, I could reproduce the problem. This is apparently because of the unfinished italic being in a list.
I wanted to implement anyway a more robust block-level elements and inline-level elements stacking algorithm, but this will have to wait 0.11.
I will nevertheless check if there's a simple fix for this specific problem, for 0.10.
comment:4 by , 18 years ago
What if I want to have apostrophes in my italic text? How do we avoid false positives trying to "fix" the user's formatting?
comment:5 by , 18 years ago
The fix will be at the HTML level, not touching the wiki text. In the above example, the last "'" character will stay as is, simply the <i> tag will be closed.
comment:6 by , 18 years ago
Milestone: | 0.10 → 0.11 |
---|
There seems to be consensus that this can wait for 0.11.
comment:7 by , 18 years ago
Keywords: | parser added |
---|---|
Priority: | low → normal |
#4702 was closed as duplicate of this one.
comment:8 by , 17 years ago
Component: | ticket system → wiki |
---|---|
Milestone: | 0.11 → 0.12 |
WikiEngine refactoring and related fixes postponed.
follow-up: 10 comment:9 by , 17 years ago
It would be nice if comments could be edited somehow; then one could at least work around the kind of problem discussed here.
comment:10 by , 17 years ago
comment:12 by , 17 years ago
Cc: | added |
---|
comment:14 by , 15 years ago
Priority: | normal → high |
---|
#8520 reports a few more examples of this behavior.
comment:16 by , 15 years ago
Cc: | added |
---|
comment:17 by , 15 years ago
Milestone: | next-major-0.1X → 0.12 |
---|
Nice test case lifted from TH:4358:
This line '''does not close bold. No problems though as it resets. Lists won't though: * '''Not closing bold... * Bold Continues here... This will be bold too as will the rest of the page...
While the big changes I mentioned in comment:3 (4 years ago, really?) are definitely still not on the radar, that specific issue seems simple enough to be addressed in the current formatter.
comment:18 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed in r8886.
Fixing the one-liner formatter fully would indeed be a bit more work, as we currently process the whole content in one go without the ability to detect natural paragraphs. But as the resulting xhtml is still well-formed, it's not a big deal and not preventing this ticket to be closed.
Example of ticket page rendering, when one of the comments is short of a closing italic/emphasis tag