Page MenuHomePhabricator

Parsoid: Adjacent annotations should be merged where possible
Closed, ResolvedPublic


Consider the wikitext:
'''Foo''' bar '''baz'''


<b>Foo</b> bar <b>baz</b>

If we remove " bar " in wikitext we are left with
which serialises to
'''Foo''''''baz''' (instead of to more sensible '''Foobaz''')

Previously this has not been a problem as we annotate each of Foo & baz as name='textStyle/bold' and then the converter only closes the <b> tag when it sees two characters with non-similar annotations (different name values).

However if we keep that functionality the following case breaks:
<b style="color:red">Red</b><b style="color:blue">Blue</b>

As we only compare name, we would consider those annotations to be the same and serialise them as one.

The only way around that in VE would be to compare all attributes /except/ data-parsoid (as that will always been different, even for annotations that are actually mergeable). Having an explicit reference to data-parsoid in VE would most definitely be a Bad Thing.

Therefore I'm suggesting that Parsoid work out if two annotations are mergeable
and automatically collapse
'''Foo''''''baz''' to '''Foobaz'''

This would also apply to anything else we treat as an annotation (e.g. links)

Version: unspecified
Severity: normal



Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:42 AM
bzimport added a project: Parsoid.
bzimport set Reference to bz49478.
  • This bug has been marked as a duplicate of bug 42803 ***
  • This bug has been marked as a duplicate of bug 48194 ***