8 <source lang="doesnotexist">
12 <div class="mw-highlight mw-content-ltr" dir="ltr"><pre>foobar</pre></div>
23 <div class="mw-highlight mw-content-ltr" dir="ltr"><pre>foo</pre></div>
28 No language specified (no wellformed xml)
35 <div class="mw-highlight mw-content-ltr" dir="ltr"><pre>bar</pre></div>
42 <source lang="doesnotexist">
43 <script>alert("pwnd")</script>
44 <IMG SRC=`javascript:alert("RSnake says, 'XSS'")`>
46 SRC=javascript:alert(
47 'XSS')
49 </script><script>alert('XSS');</script>
50 %253cscript%253ealert(document.cookie)%253c/script%253e
53 <div class="mw-highlight mw-content-ltr" dir="ltr"><pre><script>alert("pwnd")</script>
54 <IMG SRC=`javascript:alert("RSnake says, 'XSS'")`>
56 SRC=&#106;&#97;&#118;&#97;&#115;&#99;&#114;&#105;&#112;&#116;&#58;&#97;&#108;&#101;&#114;&#116;&#40;
57 &#39;&#88;&#83;&#83;&#39;&#41;
59 </script><script>alert('XSS');</script>
60 %253cscript%253ealert(document.cookie)%253c/script%253e</pre></div>
65 XSS is escaped (inline)
67 <source lang="doesnotexist" inline>
68 <script>alert("pwnd")</script>
69 <IMG SRC=`javascript:alert("RSnake says, 'XSS'")`>
71 SRC=javascript:alert(
72 'XSS')
74 </script><script>alert('XSS');</script>
75 %253cscript%253ealert(document.cookie)%253c/script%253e
78 <p><code class="mw-highlight" dir="ltr"><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</code>
83 Default behaviour (inner is pre)
85 <source lang="javascript">
89 <div class="mw-highlight mw-content-ltr" dir="ltr"><pre><span></span><span class="kd">var</span> <span class="nx">a</span><span class="p">;</span>
95 Multiline <source/> in lists
103 <ul><li> <div class="mw-highlight mw-content-ltr" dir="ltr"><pre>a
104 b</pre></div></li></ul>
105 <ul><li> foo <div class="mw-highlight mw-content-ltr" dir="ltr"><pre>a
106 b</pre></div></li></ul>
111 <div class="mw-highlight mw-content-ltr" dir="ltr">
120 <div class="mw-highlight mw-content-ltr" dir="ltr">
132 <source lang="javascript" id="foo" class="bar" dir="rtl" style="font-size: larger;">var a;</source>
134 <div id="foo" class="bar mw-highlight mw-content-rtl" dir="rtl" style="font-size: larger;"><pre><span></span><span class="kd">var</span> <span class="nx">a</span><span class="p">;</span>
140 Inline attribute (inline code)
142 Text <source lang="javascript" inline>var a;</source>.
144 <p>Text <code class="mw-highlight" dir="ltr"><span class="kd">var</span> <span class="nx">a</span><span class="p">;</span></code>.
149 Enclose none (inline code)
151 Text <source lang="javascript" enclose="none">var a;</source>.
153 <p>Text <code class="mw-highlight" dir="ltr"><span class="kd">var</span> <span class="nx">a</span><span class="p">;</span></code>.
160 {{#tag:syntaxhighlight|<nowiki>foo</nowiki>|lang="text"|inline=none}}
162 <p><code class="mw-highlight" dir="ltr">foo</code>