# This file should only contain tests using special characters
# that trip up some text editors.
# a) Already lost this test for years when removed on r12975
# b) Some text editors choke on the file due to the   character
#
# The parsoid-compatible option below is only relevant when we are running
# parser tests in integrated mode with Parsoid. This option is ignored
# when this test file is run with Parsoid in standalone mode.
!! options
parsoid-compatible=wt2html,wt2wt
version=2
!! end

!! test
External links: invalid character NUL (stripped)
!! wikitext
[http://www.example.com  test]
!! html
<p><a rel="nofollow" class="external text" href="http://www.example.com">test</a>
</p>
!! end

!! test
External links: invalid character backspace (preserved)
!! options
preprocessor=Preprocessor_Hash
!! wikitext
[http://www.example.com test]
!! html
<p>[<a rel="nofollow" class="external free" href="http://www.example.com">http://www.example.com</a> test]
</p>
!! end

!! test
Magic link: invalid character NUL (stripped)
!! wikitext
http://www.example.com  test
!! html
<p><a rel="nofollow" class="external free" href="http://www.example.com">http://www.example.com</a> test
</p>
!! end

!! test
Magic link: invalid character backspace (preserved)
!! options
preprocessor=Preprocessor_Hash
!! wikitext
http://www.example.com test
!! html
<p><a rel="nofollow" class="external free" href="http://www.example.com">http://www.example.com</a> test
</p>
!! end

!! test
External links: tab character
!! wikitext
[http://www.example.com Alice in	Wonderland]
!! html
<p><a rel="nofollow" class="external text" href="http://www.example.com">Alice in	Wonderland</a>
</p>
!! end

!! test
U+0338, bare and as entity
!! config
wgParserEnableLegacyHeadingDOM=false
wgFragmentMode=[ "html5" ]
!! options
showtocdata
parsoid={
  "modes": [ "wt2html", "html2html" ],
  "wrapSections": true
}
!! wikitext
Header

== &#x338; One & ==
&#x338; Text

== ̸ Two & ==
̸ Text
!! metadata
Sections:
 h2 index:1 toclevel:1 number:1 title:Parser_test off:8 anchor/linkAnchor:̸_One_& line:&#x338; One &amp;
 h2 index:2 toclevel:1 number:2 title:Parser_test off:42 anchor/linkAnchor:̸_Two_& line:&#x338; Two &amp;
!! html/php
<p>Header
</p>
<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>
<p>&#x338; Text
</p>
<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>
<p>&#x338; Text
</p>
!! html/parsoid
<section data-mw-section-id="0">
<p>Header</p>
</section><section data-mw-section-id="1">
<h2 id="̸_One_&amp;"><span id=".CC.B8_One_.26" typeof="mw:FallbackId"></span><span typeof="mw:Entity">&#x338;</span> One &amp;</h2>
<p><span typeof="mw:Entity">&#x338;</span> Text</p>
</section><section data-mw-section-id="2">
<h2 id="̸_Two_&amp;"><span id=".CC.B8_Two_.26" typeof="mw:FallbackId"></span>&#x338; Two &amp;</h2>
<p>&#x338; Text</p>
</section>
!! end

## Note that there's a leading \r here that's necessary for the test
!! test
Stray carriage return in text
!! options
parsoid=wt2html
!! wikitext

hiho
!! html/php
<p>
hiho
</p>
!! html/parsoid
<p>
hiho</p>
!! end
