Ticket #1015 (closed Bug: fixed)

Opened 12 months ago

Last modified 4 months ago

Badly nested italic/bold markup can cause round-trip problems from MediaWiki markup to FCK and back to MediaWiki

Reported by: ais523 Owned by:
Priority: Normal Milestone:
Component: Project : MediaWiki+FCKeditor Version: SVN
Keywords: HasPatch Cc:

Description

The MediaWiki markup

a''b'''c''d'''e

changes to the markup

a''b'''c''''''''d'''e

when converted to FCK and back to MediaWiki markup (by changing to wikitext mode, entering the markup given as an example, then changing out of and back into wikitext mode); the second markup is incorrect, as it renders as normal a, italic b, bold italic c, three apostrophes, normal d, bold e, rather than normal a, italic b, bold italic c, bold d, notmal e. I suspect this is because the correct HTML for the example markup is

a<i>b<b>c</b></i><b>d</e>e

and the markup produced by substituting two apostrophes for each opening or closing i and three apostrophes for each opening or closing b produces the output that FCK gave; this is, however, incorrect, as the MediaWiki parser doesn't interpret more than five apostrophes in a row correctly. The wikimarkup produced by the editor should be equivalent to the original in such a case, either by detecting this and similar conditions to recreate the original, or by using HTML tags rather than apostrophes to prevent such a long string of consecutive apostrophes (for instance, one correct version of the markup is

a''b'''c'''''<b>d</b>e

, produced by using HTML rather than wikimarkup at the point where the sixth apostrophe would otherwise be created).

Attachments

fckplugin.js.patch (3.0 kB) - added by justinm 7 months ago.
Possible patch to fix this issue
1015.patch (3.1 kB) - added by justinm 6 months ago.
Pro

Change History

Changed 7 months ago by justinm

Possible patch to fix this issue

Changed 6 months ago by justinm

Pro

Changed 6 months ago by justinm

I have attached a possible patch that should fix these issues.

Changed 6 months ago by fredck

  • keywords HasPatch added

Changed 4 months ago by wwalc

  • status changed from new to closed
  • resolution set to fixed

For some reasons, this patch didn't work when I tried the sample text you posted:

a''b'''c''d'''e

after applying patch, it still returned

a''b'''c''''''''d'''e

I've fixed this with [1823], it produces HTML tags when it is necessary, e.g.:

a''b'''c'''''<b>d</b>e

(ignore the previous commit: [1822], adding a space was rather a bad idea).

Note: See TracTickets for help on using tickets.