Arlolra has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/405823 )
Change subject: Fix crasher from rendering self-closed html pre tags ...................................................................... Fix crasher from rendering self-closed html pre tags For example, http://localhost:8000/fr.wikipedia.org/v3/page/html/Utilisateur%3ADepil/125767760 Bug: T185385 Change-Id: I6c2211c0cffb9f899d4efb390649e72729e0f705 --- M lib/ext/Pre/index.js M tests/parserTests.txt 2 files changed, 12 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid refs/changes/23/405823/1 diff --git a/lib/ext/Pre/index.js b/lib/ext/Pre/index.js index 1e34ad8..50b8b84 100644 --- a/lib/ext/Pre/index.js +++ b/lib/ext/Pre/index.js @@ -45,7 +45,7 @@ stx: 'html', }); - var txt = argDict.body.extsrc; + var txt = argDict.body && argDict.body.extsrc || ''; // Support nowikis in pre. Do this before stripping newlines, see test, // "<pre> with <nowiki> inside (compatibility with 1.6 and earlier)" diff --git a/tests/parserTests.txt b/tests/parserTests.txt index c1b893c..fd05393 100644 --- a/tests/parserTests.txt +++ b/tests/parserTests.txt @@ -2723,6 +2723,17 @@ !! end !! test +Self-closed pre +!! wikitext +<pre /> +!! html/php +<pre></pre> + +!! html/parsoid +<pre typeof="mw:Extension/pre" about="#mwt2" data-mw='{"name":"pre","attrs":{},"body":null}'></pre> +!! end + +!! test Parsoid: Don't paragraph-wrap fosterable content even if table syntax is unbalanced !! options parsoid=wt2html -- To view, visit https://gerrit.wikimedia.org/r/405823 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6c2211c0cffb9f899d4efb390649e72729e0f705 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/parsoid Gerrit-Branch: master Gerrit-Owner: Arlolra <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
