Opened 12 years ago

Closed 11 years ago

#1015 closed Bug (fixed)

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 (FCKeditor) - Retired
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 (2)

fckplugin.js.patch (3.0 KB) - added by Justin McCormick 12 years ago.
Possible patch to fix this issue
1015.patch (3.1 KB) - added by Justin McCormick 12 years ago.
Pro

Download all attachments as: .zip

Change History (5)

Changed 12 years ago by Justin McCormick

Attachment: fckplugin.js.patch added

Possible patch to fix this issue

Changed 12 years ago by Justin McCormick

Attachment: 1015.patch added

Pro

comment:1 Changed 12 years ago by Justin McCormick

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

comment:2 Changed 12 years ago by Frederico Caldeira Knabben

Keywords: HasPatch added

comment:3 Changed 11 years ago by Wiktor Walc

Resolution: fixed
Status: newclosed

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.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy