Santhosh has uploaded a new change for review.

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

Change subject: Keep data-mw attributes for references to avoid parsoid error
......................................................................

Keep data-mw attributes for references to avoid parsoid error

Bug: T75119
Change-Id: I86596da48ba9396a565095271b470f3511975549
---
M modules/tools/ext.cx.tools.reference.js
1 file changed, 12 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation 
refs/changes/89/177189/1

diff --git a/modules/tools/ext.cx.tools.reference.js 
b/modules/tools/ext.cx.tools.reference.js
index a5fb4b4..14e506a 100644
--- a/modules/tools/ext.cx.tools.reference.js
+++ b/modules/tools/ext.cx.tools.reference.js
@@ -215,7 +215,9 @@
        };
 
        function processReferences( $section ) {
-               var referenceAdaptor = new ReferenceCard();
+               var $souceSection, referenceAdaptor;
+
+               referenceAdaptor = new ReferenceCard();
                $section.find( '[typeof="mw:Extension/ref"]' ).each( function 
() {
                        var $reference = $( this ),
                                referenceId = $reference.prop( 'id' );
@@ -231,6 +233,15 @@
                        // Adapt references.
                        referenceAdaptor.adaptReference( referenceId );
                } );
+
+               if ( $section.is( '[typeof="mw:Extension/references"]' ) ) {
+                       // It is references listing. Copy data-mw that we strip 
before MT.
+                       // See https://phabricator.wikimedia.org/T75121 and
+                       // 
https://www.mediawiki.org/wiki/Parsoid/MediaWiki_DOM_spec#Ref_and_References
+                       $souceSection = $( '#' + $section.data( 'source' ) );
+                       $section.attr( 'data-mw', JSON.stringify( 
$souceSection.data( 'mw' ) ) );
+               }
+
        }
 
        mw.cx.tools.reference = ReferenceCard;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I86596da48ba9396a565095271b470f3511975549
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh <santhosh.thottin...@gmail.com>

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

Reply via email to