C. Scott Ananian has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370812 )

Change subject: Support gradual migration to oneway/twoway in LC markup.
......................................................................

Support gradual migration to oneway/twoway in LC markup.

Change-Id: Ib59dff22e64f235e30778a5a5b3e525e4fc7fdd3
---
M lib/html2wt/LanguageVariantHandler.js
1 file changed, 10 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid 
refs/changes/12/370812/1

diff --git a/lib/html2wt/LanguageVariantHandler.js 
b/lib/html2wt/LanguageVariantHandler.js
index 74a25dd..8644926 100644
--- a/lib/html2wt/LanguageVariantHandler.js
+++ b/lib/html2wt/LanguageVariantHandler.js
@@ -38,6 +38,16 @@
        }, new Map());
        var resultP = Promise.resolve('$E|'); // "error" flag
 
+       // Migration: `twoway` => `bidir` ; `oneway` => `unidir`
+       if (dataMWV.twoway) {
+               dataMWV.bidir = dataMWV.twoway;
+               delete dataMWV.twoway;
+       }
+       if (dataMWV.oneway) {
+               dataMWV.unidir = dataMWV.oneway;
+               delete dataMWV.oneway;
+       }
+
        flags = Object.keys(dataMWV).reduce(function(f, k) {
                if (Consts.LCNameMap.has(k)) {
                        f.add(Consts.LCNameMap.get(k));

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib59dff22e64f235e30778a5a5b3e525e4fc7fdd3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: C. Scott Ananian <canan...@wikimedia.org>

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

Reply via email to