Esanders has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/185193

Change subject: Unwrap slug wrappers when converting to a real paragraph
......................................................................

Unwrap slug wrappers when converting to a real paragraph

If you leave the slug wrappers on not only do you have a messy DOM,
but slug wrappers get collectively deleted in onSurfaceObserverSlugEnter.

Bug: T85948
Change-Id: I1c6ee4102f415a1ca25a968f8a7647bb19f76ce4
---
M src/ce/ve.ce.Surface.js
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/93/185193/1

diff --git a/src/ce/ve.ce.Surface.js b/src/ce/ve.ce.Surface.js
index 9a5e305..2e61877 100644
--- a/src/ce/ve.ce.Surface.js
+++ b/src/ce/ve.ce.Surface.js
@@ -2213,6 +2213,11 @@
                                this.slugFragment = null;
                        }
                } else {
+                       // Unwrap the ve-ce-branchNode-blockSlugWrapper wrapper 
from the paragraph
+                       this.getDocument().getBranchNodeFromOffset( 
slugFragmentRange.start + 1 ).$element.unwrap();
+                       // Modifying the DOM above breaks cursor position, so 
restore
+                       this.showSelection( this.getModel().getSelection() );
+
                        model.applyStaging();
                        this.slugFragment = null;
                }

-- 
To view, visit https://gerrit.wikimedia.org/r/185193
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1c6ee4102f415a1ca25a968f8a7647bb19f76ce4
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to