Subramanya Sastry has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393846 )

Change subject: Use env.wrapSections to decide whether to add <section> tags or 
not
......................................................................

Use env.wrapSections to decide whether to add <section> tags or not

* Initialize the env property with the parsoid config setting.

* This lets tests, scripts, and api requests to opt in/out of this
  independent of the parsoid config option without testing both
  settings.

Change-Id: I276f2a7c5d954ea320d32d6589e94c6657a3548b
---
M lib/config/MWParserEnvironment.js
M lib/wt2html/pp/processors/wrapSections.js
2 files changed, 4 insertions(+), 1 deletion(-)


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

diff --git a/lib/config/MWParserEnvironment.js 
b/lib/config/MWParserEnvironment.js
index be26705..01a5a75 100644
--- a/lib/config/MWParserEnvironment.js
+++ b/lib/config/MWParserEnvironment.js
@@ -139,6 +139,9 @@
                wiki: null,
        };
 
+       // Default
+       this.wrapSections = parsoidConfig.wrapSections;
+
        // FIXME: This is temporary and will be replaced after the call to
        // `switchToConfig`.  However, it may somehow be used in the
        // `ConfigRequest` along the way. Perhaps worth seeing if that can be
diff --git a/lib/wt2html/pp/processors/wrapSections.js 
b/lib/wt2html/pp/processors/wrapSections.js
index 99f1947..0ac5b54 100644
--- a/lib/wt2html/pp/processors/wrapSections.js
+++ b/lib/wt2html/pp/processors/wrapSections.js
@@ -272,7 +272,7 @@
 }
 
 function wrapSections(rootNode, env, options, atTopLevel) {
-       if (!atTopLevel || (!env.conf.parsoid.wrapSections && 
!env.wrapSections)) {
+       if (!atTopLevel || !env.wrapSections) {
                return;
        }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I276f2a7c5d954ea320d32d6589e94c6657a3548b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to