Catrope has submitted this change and it was merged.

Change subject: About-group extra DOM data in toDomElements
......................................................................


About-group extra DOM data in toDomElements

Although marked as data-ve-ignore, it isn't ignored by Parsoid,
so about group it together as well.

Bug: 59002
Change-Id: I263e316fb10f3e6f23fc1d409686cdefbd28fafa
---
M modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js
1 file changed, 6 insertions(+), 2 deletions(-)

Approvals:
  Catrope: Verified; Looks good to me, approved



diff --git a/modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js 
b/modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js
index 2039acd..826239e 100644
--- a/modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js
+++ b/modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js
@@ -89,7 +89,7 @@
 };
 
 ve.dm.MWTransclusionNode.static.toDomElements = function ( dataElement, doc, 
converter ) {
-       var els, currentDom, i, len, wrapper,
+       var els, currentDom, i, len, wrapper, aboutGroup,
                index = converter.getStore().indexOfHash( OO.getHash( [ 
this.getHashObject( dataElement ), undefined ] ) ),
                originalMw = dataElement.attributes.originalMw;
 
@@ -108,9 +108,11 @@
                        els = [ doc.createElement( 
dataElement.attributes.originalDomElements[0].nodeName ) ];
                } else {
                        els = [ doc.createElement( 'span' ) ];
-                       // For the clipboard use the current DOM contents but 
mark is ignored
+                       // For the clipboard use the current DOM contents but 
mark as ignored
                        // for the converter
                        currentDom = converter.getStore().value( index );
+                       // About-group elements together
+                       aboutGroup = 'g' + Math.random();
                        if ( currentDom ) {
                                currentDom = ve.copyDomElements( currentDom, 
doc );
                                // i = 0 is the data-mw span
@@ -122,8 +124,10 @@
                                                currentDom[i] = wrapper;
                                        }
                                        currentDom[i].setAttribute( 
'data-ve-ignore', 'true' );
+                                       currentDom[i].setAttribute( 'about', 
aboutGroup );
                                        els.push( currentDom[i] );
                                }
+                               els[0].setAttribute( 'about', aboutGroup );
                        }
                }
                // All we need to send back to Parsoid is the original 
transclusion marker, with a

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I263e316fb10f3e6f23fc1d409686cdefbd28fafa
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: wmf/1.23wmf9
Gerrit-Owner: Catrope <roan.katt...@gmail.com>
Gerrit-Reviewer: Catrope <roan.katt...@gmail.com>
Gerrit-Reviewer: Esanders <esand...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to