jenkins-bot has submitted this change and it was merged. Change subject: Check for all important elements when pasting between instances ......................................................................
Check for all important elements when pasting between instances It's not just spans that can get corrupted. This fixes the pasting of block aliens between VE instances in Chrome. Change-Id: I9f19e2e10d18857e3b3fa8417935408f98c498d0 --- M src/ce/ve.ce.Surface.js 1 file changed, 4 insertions(+), 4 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/src/ce/ve.ce.Surface.js b/src/ce/ve.ce.Surface.js index 33e797e..fc72047 100644 --- a/src/ce/ve.ce.Surface.js +++ b/src/ce/ve.ce.Surface.js @@ -1856,7 +1856,7 @@ data, doc, htmlDoc, $images, i, context, left, right, contextRange, items = [], - importantSpan = 'span[id],span[typeof],span[rel]', + importantElement = '[id],[typeof],[rel]', importRules = this.getSurface().getImportRules(), beforePasteData = this.beforePasteData || {}, selection = this.model.getSelection(), @@ -2006,11 +2006,11 @@ if ( // HACK: Allow the test runner to force the use of clipboardData clipboardKey === 'useClipboardData-0' || ( - $elements.find( importantSpan ).andSelf().filter( importantSpan ).length > 0 && - this.$pasteTarget.find( importantSpan ).length === 0 + $elements.find( importantElement ).andSelf().filter( importantElement ).length > 0 && + this.$pasteTarget.find( importantElement ).length === 0 ) ) { - // CE destroyed an important span, so revert to using clipboard data + // CE destroyed an important element, so revert to using clipboard data htmlDoc = ve.createDocumentFromHtml( beforePasteData.html ); // Remove the pasteProtect class. See #onCopy. $( htmlDoc ).find( 'span' ).removeClass( 've-pasteProtect' ); -- To view, visit https://gerrit.wikimedia.org/r/204749 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9f19e2e10d18857e3b3fa8417935408f98c498d0 Gerrit-PatchSet: 1 Gerrit-Project: VisualEditor/VisualEditor Gerrit-Branch: master Gerrit-Owner: Esanders <esand...@wikimedia.org> Gerrit-Reviewer: Catrope <roan.katt...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits