Debian Codegraph @

tests/parser/badCharacters.txt

raw
1 # This file should only contain tests using special characters
2 # that trip up some text editors.
3 # a) Already lost this test for years when removed on r12975
4 # b) Some text editors choke on the file due to the character
5 #
6 # The parsoid-compatible option below is only relevant when we are running
7 # parser tests in integrated mode with Parsoid. This option is ignored
8 # when this test file is run with Parsoid in standalone mode.
9 !! options
10 parsoid-compatible=wt2html,wt2wt
11 version=2
12 !! end
13
14 !! test
15 External links: invalid character NUL (stripped)
16 !! wikitext
17 [http://www.example.com test]
18 !! html
19 <p><a rel="nofollow" class="external text" href="http://www.example.com">test</a>
20 </p>
21 !! end
22
23 !! test
24 External links: invalid character backspace (preserved)
25 !! options
26 preprocessor=Preprocessor_Hash
27 !! wikitext
28 [http://www.example.com test]
29 !! html
30 <p>[<a rel="nofollow" class="external free" href="http://www.example.com">http://www.example.com</a> test]
31 </p>
32 !! end
33
34 !! test
35 Magic link: invalid character NUL (stripped)
36 !! wikitext
37 http://www.example.com test
38 !! html
39 <p><a rel="nofollow" class="external free" href="http://www.example.com">http://www.example.com</a> test
40 </p>
41 !! end
42
43 !! test
44 Magic link: invalid character backspace (preserved)
45 !! options
46 preprocessor=Preprocessor_Hash
47 !! wikitext
48 http://www.example.com test
49 !! html
50 <p><a rel="nofollow" class="external free" href="http://www.example.com">http://www.example.com</a> test
51 </p>
52 !! end
53
54 !! test
55 External links: tab character
56 !! wikitext
57 [http://www.example.com Alice in Wonderland]
58 !! html
59 <p><a rel="nofollow" class="external text" href="http://www.example.com">Alice in Wonderland</a>
60 </p>
61 !! end
62
63 !! test
64 U+0338, bare and as entity
65 !! config
66 wgParserEnableLegacyHeadingDOM=false
67 wgFragmentMode=[ "html5" ]
68 !! options
69 showtocdata
70 parsoid={
71 "modes": [ "wt2html", "html2html" ],
72 "wrapSections": true
73 }
74 !! wikitext
75 Header
76
77 == &#x338; One & ==
78 &#x338; Text
79
80 == ̸ Two & ==
81 ̸ Text
82 !! metadata
83 Sections:
84 h2 index:1 toclevel:1 number:1 title:Parser_test off:8 anchor/linkAnchor:̸_One_& line:&#x338; One &amp;
85 h2 index:2 toclevel:1 number:2 title:Parser_test off:42 anchor/linkAnchor:̸_Two_& line:&#x338; Two &amp;
86 !! html/php
87 <p>Header
88 </p>
89 <div class="mw-heading mw-heading2"><h2 id="&#x338;_One_&amp;">&#x338; One &amp;</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: &#x338; One &amp;">edit</a><span class="mw-editsection-bracket">]</span></span></div>
90 <p>&#x338; Text
91 </p>
92 <div class="mw-heading mw-heading2"><h2 id="&#x338;_Two_&amp;">&#x338; Two &amp;</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: &#x338; Two &amp;">edit</a><span class="mw-editsection-bracket">]</span></span></div>
93 <p>&#x338; Text
94 </p>
95 !! html/parsoid
96 <section data-mw-section-id="0">
97 <p>Header</p>
98 </section><section data-mw-section-id="1">
99 <h2 id="̸_One_&amp;"><span id=".CC.B8_One_.26" typeof="mw:FallbackId"></span><span typeof="mw:Entity">&#x338;</span> One &amp;</h2>
100 <p><span typeof="mw:Entity">&#x338;</span> Text</p>
101 </section><section data-mw-section-id="2">
102 <h2 id="̸_Two_&amp;"><span id=".CC.B8_Two_.26" typeof="mw:FallbackId"></span>&#x338; Two &amp;</h2>
103 <p>&#x338; Text</p>
104 </section>
105 !! end
106
107 ## Note that there's a leading \r here that's necessary for the test
108 !! test
109 Stray carriage return in text
110 !! options
111 parsoid=wt2html
112 !! wikitext
113 hiho
114 !! html/php
115 <p> hiho
116 </p>
117 !! html/parsoid
118 <p> hiho</p>
119 !! end