Ordered application of annotations to avoid fragmentation (e.g. ''[[Foo|Fo]]''[[Foo|o]])
OpenPublic

bzimport added a project: VisualEditor-DataModel.Via ConduitNov 22 2014, 1:58 AM
bzimport set Reference to bz50098.
Ironholds created this task.Via LegacyJun 24 2013, 2:13 PM
Jdforrester-WMF added a comment.Via ConduitJun 24 2013, 2:35 PM

Annotations get applied to the text in the order that they're applied in reality; we should probably make links higher-priority. Thus [[Foo|F'''''o''o''']] rather than [[Foo|F]]'''''[[Foo|o]]''[[Foo|F]]'''.

Esanders added a comment.Via ConduitJun 24 2013, 5:13 PM

Except you'd probably rather have ''[[Foo|Bar]]'' than [[Foo|''Bar'']]

Jdforrester-WMF added a comment.Via ConduitJun 24 2013, 5:44 PM

(In reply to comment #2)

Except you'd probably rather have ''[[Foo|Bar]]'' than [[Foo|''Bar'']]

Yeah; so it should only break out when it's not entirely nested? Spoke to Roan about this - he says it's a relatively-major change in DM that he did "about a quarter" of the work for as part of DM rewrite 2 (or similar). Pull from release?

Jdforrester-WMF added a comment.Via ConduitJul 14 2013, 11:56 PM

To re-visit this, some rules I think encapsulate what we want:

  • Spanning annotations should never be broken (because that changes the render/interaction result), in the following order:
    • Links
    • Superscript / Subscript
    • Underline / Strikethrough

So:

  • <a href="Foo"><i>Foo</i>Bar</a> -> [[Foo|''Foo''Bar]], not ''[[Foo]]''[[Foo|Bar]]
  • <u>Foo<b>Bar</b></u> -> <u>Foo'''Bar'''</u>, not <u>Foo</u>'''<u>Bar</u>'''
  • <u>Foo<a href="Bar">Bar</u>Baz</a> -> <u>Foo</u>[[Bar|<u>Bar</u>Baz]], not <u>Foo[[Bar]]</u>[[Bar|Baz]]
  • <sup>Foo<s>Bar</sup>Baz</s> -> <sup>Foo<s>Bar</s></sup><s>Baz</s>, not <sup>Foo</sup><sup><s>Bar</s></sup><s>Baz</s>
  • Annotations to links' anchors which are otherwise identical to their target

So:

  • <a href="Foo"><i>Foo</i></a> -> ''[[Foo]]'', not [[Foo|''Foo'']]
  • Otherwise, annotations should be minimally-spanning

So:

  • <a href="Foo"><i>Bar</i></a> -> ''[[Foo|Bar]]'', not [[Foo|''Bar'']]
  • <i><b>Foo</b>Bar</i> -> '''''Foo'''Bar'' not '''''Foo'''''<nowiki />''Bar''

Does this achieve what we want? (Obviously some of this is already done by Parsoid.)

Jdforrester-WMF added a comment.Via ConduitAug 19 2013, 9:58 PM
  • Bug 52912 has been marked as a duplicate of this bug. ***
Elitre added a comment.Via ConduitAug 21 2013, 2:07 PM

In the meantime, can we suggest workarounds to "get the code right"?
I.e. to avoid [[Foo|''Bar'']] you should italicize first, and link only after that. I added this to the Italian User guide, other tips I might be missing? Thanks.

Thryduulf added a comment.Via ConduitAug 23 2013, 10:04 AM

Bug 51422 seems to cover the same ground as this, is it worth keeping as a separate case or better to merge?

Jdforrester-WMF added a comment.Via ConduitAug 23 2013, 5:27 PM

(In reply to comment #7)

Bug 51422 seems to cover the same ground as this, is it worth keeping as a
separate case or better to merge?

Merge - thanks for the spot.

Jdforrester-WMF added a comment.Via ConduitAug 23 2013, 5:29 PM
  • Bug 51422 has been marked as a duplicate of this bug. ***
Jdforrester-WMF added a comment.Via ConduitNov 19 2013, 10:12 AM
  • Bug 54092 has been marked as a duplicate of this bug. ***
Jdforrester-WMF added a comment.Via ConduitMar 11 2014, 1:37 AM
  • Bug 51054 has been marked as a duplicate of this bug. ***
Jdforrester-WMF added a comment.Via ConduitNov 10 2014, 11:17 AM
  • Bug 73201 has been marked as a duplicate of this bug. ***
Jdforrester-WMF moved this task to Backlog on the VisualEditor workboard.Via WebNov 24 2014, 1:22 AM
Ironholds removed a subscriber: Ironholds.Via WebDec 5 2014, 7:45 PM
Jdforrester-WMF moved this task to TR9: ???? on the VisualEditor workboard.Via WebMar 30 2015, 9:36 PM
Jdforrester-WMF set Story Points to 40.Via WebApr 1 2015, 7:11 PM
Jdforrester-WMF moved this task to Backlog on the VisualEditor 2014/15 Q4 blockers workboard.Via WebApr 15 2015, 6:22 PM
Trizek-WMF added a subscriber: Trizek-WMF.Via WebJun 1 2015, 9:00 PM
Jdforrester-WMF added a project: Epic.Via WebJun 2 2015, 8:53 PM
Jdforrester-WMF moved this task to Backlog on the VisualEditor workboard.Via WebJun 18 2015, 12:36 AM
Jdforrester-WMF added a comment.Via WebFri, Jul 10, 6:08 PM

Now that T105239: Enable scrubWikitext=1 in VisualEditor's save route to Parsoid is done, this should only impact non-MW users in terms of save output. Still a blocker for sane RTC, but that's not a priority.

Jdforrester-WMF lowered the priority of this task from "Normal" to "Low".Via WebFri, Jul 10, 6:11 PM
Jdforrester-WMF changed the title from "VisualEditor: Ordered application of annotations to avoid fragmentation (e.g. ''[[Foo|Fo]]''[[Foo|o]])" to "Ordered application of annotations to avoid fragmentation (e.g. ''[[Foo|Fo]]''[[Foo|o]])".Via WebFri, Jul 10, 6:21 PM
Jdforrester-WMF placed this task up for grabs.
Jdforrester-WMF removed Story Points.

Add Comment