!! Version 2 # Force the test runner to ensure the extension is loaded !! hooks source !! endhooks !! test Non-existent language !! wikitext foobar !! html
foobar
!! end !! test No language specified !! wikitext foo !! html
foo
!! end !! test No language specified (no wellformed xml) !! config !! wikitext bar !! html
bar
!! end !! test XSS is escaped !! 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) !! 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) !! wikitext var a; !! html
var a;
!! end !! test Multiline in lists !! wikitext * a b * foo a b !! html+untidy !! html+tidy !! end !! test Custom attributes !! wikitext var a; !! html
var a;
!! end !! test Inline attribute (inline code) !! wikitext Text var a;. !! html

Text var a;.

!! end !! test Enclose none (inline code) !! wikitext Text var a;. !! html

Text var a;.

!! end !! test Enclose with nowiki !! wikitext {{#tag:syntaxhighlight|foo|lang="text"|inline=none}} !! html

foo

!! end !! test No code !! wikitext !! html
!! end !! test Just whitespace !! wikitext !! html
!! end !! test tabs plus tidy (T32930, T59826) !! wikitext function doSomething() { var foo, bar; if (baz) { !! html+tidy
function doSomething() {
	var	foo,
		bar;
	if (baz) {
!! end