Last modified: 2014-04-17 22:50:53 UTC
Created attachment 14949 [details] Screenshot Steps to reproduce: 1.Open a page with 2,Add a bullet list or numbered list 3.Add an empty bullet item 4.Add indentation to it 5.Select the previous item 6.Change the paragraph style of the previous item Observed Result: An error appears in the console Uncaught Error: Unbalanced set of replace operations found Now press enter to add another item : Uncaught Error: Unbalanced input passed to document Press undo: Uncaught Error: Offset could not be translated to a DOM element and offset See the screenshot attached Test Environment: https://test2.wikipedia.org/ Browser: Chrome Version 26.0.1410.65 & FF 25 OS: MAC OS X 10. 8. 5 Page:https://test2.wikipedia.org/wiki/27thmarChrome?veaction=edit
It suffices to do a format change on any list item that has a nested list item directly beneath it. In other words, if you have the list * Foo * Bar ** Baz then changing "Bar" to a heading will break. It doesn't matter if "Baz" is empty, it just has to be at a deeper list level than "Bar".
I've figured out why this bug happens and I know how to fix it. I have to go now but I'll write a patch when I get back (~1.5 hours)
Change 123892 had a related patch set uploaded by Catrope: Adjust range manually in isolateAndUnwrap() https://gerrit.wikimedia.org/r/123892
Change 124493 had a related patch set uploaded by Catrope: Exclude insertions in ve.dm.SurfaceFragment#isolateAndUnwrap https://gerrit.wikimedia.org/r/124493
Change 123892 abandoned by Catrope: Adjust range manually in isolateAndUnwrap() Reason: Superseded by https://gerrit.wikimedia.org/r/#/c/124493/ https://gerrit.wikimedia.org/r/123892
Change 124493 merged by jenkins-bot: Exclude insertions in ve.dm.SurfaceFragment#isolateAndUnwrap https://gerrit.wikimedia.org/r/124493
Verified the fix on test 2
Verified the fix in:https://en.wikipedia.org/wiki/User:RYasmeen_(WMF)/sandbox?veaction=edit