!! options parsoid-compatible=wt2html,wt2wt version=2 !! end # Force the test runner to ensure the extension is loaded !! hooks source !! endhooks !! test Non-existent language !! wikitext foobar !! html/php
foobar
!! html/parsoid
foobar
!! end !! test No language specified !! options parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext foo !! html
foo
!! end !! test No language specified (no wellformed xml) !! options parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! config !! wikitext bar !! html
bar
!! end !! test XSS is escaped !! options parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext %253cscript%253ealert(document.cookie)%253c/script%253e !! html
<script>alert("pwnd")</script>
<IMG SRC=`javascript:alert("RSnake says, 'XSS'")`>
<IMG
SRC=&#106;&#97;&#118;&#97;&#115;&#99;&#114;&#105;&#112;&#116;&#58;&#97;&#108;&#101;&#114;&#116;&#40;
&#39;&#88;&#83;&#83;&#39;&#41;
\";alert('XSS');//
</script><script>alert('XSS');</script>
%253cscript%253ealert(document.cookie)%253c/script%253e
!! end !! test XSS is escaped (inline) !! options parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext %253cscript%253ealert(document.cookie)%253c/script%253e !! html

<script>alert("pwnd")</script> <IMG SRC=`javascript:alert("RSnake says, 'XSS'")`> <IMG SRC=&#106;&#97;&#118;&#97;&#115;&#99;&#114;&#105;&#112;&#116;&#58;&#97;&#108;&#101;&#114;&#116;&#40; &#39;&#88;&#83;&#83;&#39;&#41; \";alert('XSS');// </script><script>alert('XSS');</script> %253cscript%253ealert(document.cookie)%253c/script%253e

!! end !! test Default behaviour (inner is pre) !! options parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext var a; !! html
var a;
!! end !! test Multiline in lists !! options parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext *a b *foo a b !! html !! end !! test Custom attributes !! options parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext var a; !! html
var a;
!! end # The html/parsoid section verifies that Parsoid can handle attributes # that are not in key=value XML-like syntax. !! test Inline attribute (inline code) !! options parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext Text var a;. !! html/php

Text var a;.

!! html/parsoid

Text var a;.

!! end !! test Enclose none (inline code) !! options parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext Text var a;. !! html

Text var a;.

!! end !! test Enclose with nowiki !! options disabled parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{#tag:syntaxhighlight|foo|lang="text"|inline=none}} !! html/php

foo

!! html/parsoid

foo

!! end !! test Self-closing tag !! options parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext !! html
!! end !! test No code !! options parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext !! html
!! end !! test Just whitespace !! options parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext !! html
!! end !! test tabs plus tidy (T32930, T59826) !! options parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext function doSomething() { var foo, bar; if (baz) { !! html
function doSomething() {
	var	foo,
		bar;
	if (baz) {
!! end !! test deprecated source tag adds tracking category !! options parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! options cat nohtml !! wikitext print('Hi') !! html/php cat=Pages_using_deprecated_source_tags sort= !! end !! test deprecated enclose option adds tracking category !! options parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } cat nohtml !! wikitext print('Hi') !! html/php cat=Pages_using_deprecated_enclose_attributes sort= !! end