Edgewall Software
Modify

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)

comment-missed-a-quote-char.png (18.5 KB ) - added by Emmanuel Blot 18 years ago.
Example of ticket page rendering, when one of the comments is short of a closing italic/emphasis tag

Download all attachments as: .zip

Change History (19)

by Emmanuel Blot, 18 years ago

Example of ticket page rendering, when one of the comments is short of a closing italic/emphasis tag

comment:1 by anonymous, 18 years ago

Can you post the exact comment which was causing this? I can't reproduce the issue.

comment:2 by Emmanuel Blot, 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 Christian Boos, 18 years ago

Milestone: 0.10
Owner: changed from Jonas Borgström to Christian Boos

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 anonymous, 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 Christian Boos, 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 Manuzhai, 18 years ago

Milestone: 0.100.11

There seems to be consensus that this can wait for 0.11.

comment:7 by Christian Boos, 18 years ago

Keywords: parser added
Priority: lownormal

#4702 was closed as duplicate of this one.

comment:8 by Christian Boos, 18 years ago

Component: ticket systemwiki
Milestone: 0.110.12

WikiEngine refactoring and related fixes postponed.

comment:9 by anonymous, 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.

in reply to:  9 comment:10 by Emmanuel Blot, 17 years ago

Replying to anonymous:

It would be nice if comments could be edited somehow; then one could at least work around the kind of problem discussed here.

There is a dedicated ticket for this feature (#454), please do not deviate the thread from the original topic.

comment:11 by Emmanuel Blot, 17 years ago

#5771 marked as a dup.

comment:12 by anonymous, 17 years ago

Cc: dserodio@… added

comment:13 by Christian Boos, 17 years ago

Severity: minornormal

#6344 was closed as duplicate of this ticket.

comment:14 by Christian Boos, 15 years ago

Priority: normalhigh

#8520 reports a few more examples of this behavior.

comment:15 by Christian Boos, 15 years ago

#8661 was closed as duplicate of this ticket.

comment:16 by Ryan J Ollos <ryano@…>, 15 years ago

Cc: ryano@… added

comment:17 by Christian Boos, 15 years ago

Milestone: next-major-0.1X0.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 Christian Boos, 15 years ago

Resolution: fixed
Status: newclosed

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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.