Santhosh has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401371 )

Change subject: Support references wrapped in <sup> instead of <span>
......................................................................

Support references wrapped in <sup> instead of <span>

Support both span and sup so that there is nothing to worry
about transition.

Bug: T45094
Change-Id: I54a02c7084a68ab8b7ea1ab0eda9359ee38b222a
---
M lib/translationunits/MWReference.js
M test/translationunits/MWReference.test.json
2 files changed, 33 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/cxserver 
refs/changes/71/401371/1

diff --git a/lib/translationunits/MWReference.js 
b/lib/translationunits/MWReference.js
index 337f24e..96a4d9f 100644
--- a/lib/translationunits/MWReference.js
+++ b/lib/translationunits/MWReference.js
@@ -60,7 +60,7 @@
        return this.node;
 } );
 
-MWReference.matchTagNames = [ 'span' ];
+MWReference.matchTagNames = [ 'span', 'sup' ];
 MWReference.matchRdfaTypes = [ 'dc:references', 'mw:Extension/ref' ];
 
 module.exports = MWReference;
diff --git a/test/translationunits/MWReference.test.json 
b/test/translationunits/MWReference.test.json
index d058d7a..8e80510 100644
--- a/test/translationunits/MWReference.test.json
+++ b/test/translationunits/MWReference.test.json
@@ -32,6 +32,38 @@
                }
        },
        {
+               "desc": "Adapting a reference with plain text content, sup tag",
+               "from": "en",
+               "to": "es",
+               "source": {
+                       "name": "sup",
+                       "attributes": {
+                               "id": "trncttm-1",
+                               "rel": "dc:references",
+                               "typeof": "mw:Extension/ref",
+                               "class": "mw-ref",
+                               "data-mw": 
"{\"name\":\"ref\",\"body\":{\"html\":\"Hello reference\"}}"
+                       }
+               },
+               "result": {
+                       "attributes": {
+                               "id": "trncttm-1",
+                               "rel": "dc:references",
+                               "typeof": "mw:Extension/ref",
+                               "class": "mw-ref",
+                               "data-mw": {
+                                       "name": "ref",
+                                       "body": {
+                                               "html": "[en→es]Hello reference"
+                                       }
+                               },
+                               "data-cx": {
+                                       "adapted": true
+                               }
+                       }
+               }
+       },
+       {
                "desc": "Not adapting a reference with no data-mw.body",
                "from": "en",
                "to": "es",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I54a02c7084a68ab8b7ea1ab0eda9359ee38b222a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/cxserver
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