# local format section links in edit comment text as local links
# notoc disable table of contents
# thumbsize=NNN set the default thumb size to NNNpx for this test
+# wrap include the normal wrapper <div class="mw-parser-output"> (since 1.30)
#
# You can also set the following parser properties via test options:
# wgEnableUploads, wgAllowExternalImages, wgMaxTocLevel,
Magic Word: {{FULLPAGENAME}}
!! options
title=[[User:Ævar Arnfjörð Bjarmason]]
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{FULLPAGENAME}}
-!! html
+!! html/*
<p>User:Ævar Arnfjörð Bjarmason
</p>
!! end
Magic Word: {{FULLPAGENAMEE}}
!! options
title=[[User:Ævar Arnfjörð Bjarmason]]
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{FULLPAGENAMEE}}
-!! html
+!! html/*
<p>User:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason
</p>
!! end
Magic Word: {{TALKSPACE}}
!! options
title=[[User:Ævar Arnfjörð Bjarmason]]
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{TALKSPACE}}
-!! html
+!! html/*
<p>User talk
</p>
!! end
Magic Word: {{TALKSPACE}}, same namespace
!! options
title=[[User talk:Ævar Arnfjörð Bjarmason]]
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{TALKSPACE}}
-!! html
+!! html/*
<p>User talk
</p>
!! end
Magic Word: {{TALKSPACE}}, main namespace
!! options
title=[[Parser Test]]
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{TALKSPACE}}
-!! html
+!! html/*
<p>Talk
</p>
!! end
Magic Word: {{TALKSPACEE}}
!! options
title=[[User:Ævar Arnfjörð Bjarmason]]
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{TALKSPACEE}}
-!! html
+!! html/*
<p>User_talk
</p>
!! end
Magic Word: {{SUBJECTSPACE}}
!! options
title=[[User talk:Ævar Arnfjörð Bjarmason]]
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{SUBJECTSPACE}}
-!! html
+!! html/*
<p>User
</p>
!! end
Magic Word: {{SUBJECTSPACE}}, same namespace
!! options
title=[[User:Ævar Arnfjörð Bjarmason]]
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{SUBJECTSPACE}}
-!! html
+!! html/*
<p>User
</p>
!! end
Magic Word: {{SUBJECTSPACE}}, main namespace
!! options
title=[[Parser Test]]
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{SUBJECTSPACE}}
-!! html
+!! html/*
!! end
Magic Word: {{SUBJECTSPACEE}}
!! options
title=[[User talk:Ævar Arnfjörð Bjarmason]]
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{SUBJECTSPACEE}}
-!! html
+!! html/*
<p>User
</p>
!! end
Magic Word: {{NAMESPACE}}
!! options
title=[[User:Ævar Arnfjörð Bjarmason]]
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{NAMESPACE}}
-!! html
+!! html/*
<p>User
</p>
!! end
Magic Word: {{NAMESPACEE}}
!! options
title=[[User:Ævar Arnfjörð Bjarmason]]
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{NAMESPACEE}}
-!! html
+!! html/*
<p>User
</p>
!! end
Magic Word: {{NAMESPACENUMBER}}
!! options
title=[[User:Ævar Arnfjörð Bjarmason]]
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{NAMESPACENUMBER}}
-!! html
+!! html/*
<p>2
</p>
!! end
Magic Word: {{SUBPAGENAME}}
!! options
title=[[Ævar Arnfjörð Bjarmason/sub ö]] subpage
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{SUBPAGENAME}}
-!! html
+!! html/*
<p>sub ö
</p>
!! end
Magic Word: {{SUBPAGENAMEE}}
!! options
title=[[Ævar Arnfjörð Bjarmason/sub ö]] subpage
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{SUBPAGENAMEE}}
-!! html
+!! html/*
<p>sub_%C3%B6
</p>
!! end
Magic Word: {{ROOTPAGENAME}}
!! options
title=[[Ævar Arnfjörð Bjarmason/sub/sub2]] subpage
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{ROOTPAGENAME}}
-!! html
+!! html/*
<p>Ævar Arnfjörð Bjarmason
</p>
!! end
Magic Word: {{ROOTPAGENAMEE}}
!! options
title=[[Ævar Arnfjörð Bjarmason/sub/sub2]] subpage
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{ROOTPAGENAMEE}}
-!! html
+!! html/*
<p>%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason
</p>
!! end
Magic Word: {{BASEPAGENAME}}
!! options
title=[[Ævar Arnfjörð Bjarmason/sub]] subpage
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{BASEPAGENAME}}
-!! html
+!! html/*
<p>Ævar Arnfjörð Bjarmason
</p>
!! end
Magic Word: {{BASEPAGENAMEE}}
!! options
title=[[Ævar Arnfjörð Bjarmason/sub]] subpage
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{BASEPAGENAMEE}}
-!! html
+!! html/*
<p>%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason
</p>
!! end
Magic Word: {{TALKPAGENAME}}
!! options
title=[[User:Ævar Arnfjörð Bjarmason]]
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{TALKPAGENAME}}
-!! html
+!! html/*
<p>User talk:Ævar Arnfjörð Bjarmason
</p>
!! end
Magic Word: {{TALKPAGENAMEE}}
!! options
title=[[User:Ævar Arnfjörð Bjarmason]]
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{TALKPAGENAMEE}}
-!! html
+!! html/*
<p>User_talk:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason
</p>
!! end
Magic Word: {{SUBJECTPAGENAME}}
!! options
title=[[User talk:Ævar Arnfjörð Bjarmason]]
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{SUBJECTPAGENAME}}
-!! html
+!! html/*
<p>User:Ævar Arnfjörð Bjarmason
</p>
!! end
Magic Word: {{SUBJECTPAGENAMEE}}
!! options
title=[[User talk:Ævar Arnfjörð Bjarmason]]
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{SUBJECTPAGENAMEE}}
-!! html
+!! html/*
<p>User:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason
</p>
!! end
!! test
Magic Word: {{NUMBEROFFILES}}
+!! options
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{NUMBEROFFILES}}
-!! html
+!! html/*
<p>7
</p>
!! end
Magic Word: {{PAGENAME}}
!! options
title=[[User:Ævar Arnfjörð Bjarmason]]
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{PAGENAME}}
-!! html
+!! html/*
<p>Ævar Arnfjörð Bjarmason
</p>
!! end
Magic Word: {{PAGENAME}} with metacharacters
!! options
title=[['foo & bar = baz']]
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
''{{PAGENAME}}''
!! html/php
Magic Word: {{PAGENAME}} with metacharacters (T28781)
!! options
title=[[*RFC 1234 http://example.com/]]
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{PAGENAME}}
!! html/php
Magic Word: {{PAGENAMEE}}
!! options
title=[[User:Ævar Arnfjörð Bjarmason]]
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{PAGENAMEE}}
-!! html
+!! html/*
<p>%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason
</p>
!! end
Magic Word: {{PAGENAMEE}} with metacharacters (T28781)
!! options
title=[[*RFC 1234 http://example.com/]]
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{PAGENAMEE}}
!! html/php
!! test
Magic Word: {{REVISIONID}}
+!! options
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{REVISIONID}}
-!! html
+!! html/*
<p>1337
</p>
!! end
!! test
Magic Word: {{SCRIPTPATH}}
+!! options
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{SCRIPTPATH}}
-!! html
+!! html/*
!! end
!! test
Magic Word: {{STYLEPATH}}
+!! options
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{STYLEPATH}}
-!! html
+!! html/*
<p>/skins
</p>
!! end
!! test
Magic Word: {{SERVER}}
+!! options
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{SERVER}}
-!! html
+!! html/*
<p><a rel="nofollow" class="external free" href="http://example.org">http://example.org</a>
</p>
!! end
!! test
Magic Word: {{SERVERNAME}}
+!! options
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{SERVERNAME}}
-!! html
+!! html/*
<p>example.org
</p>
!! end
!! test
Magic Word: {{SITENAME}}
+!! options
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{SITENAME}}
-!! html
+!! html/*
<p>MediaWiki
</p>
!! end
Magic Word: {{PAGELANGUAGE}}
!! options
language=fr
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{PAGELANGUAGE}}
-!! html
+!! html/*
<p>fr
</p>
!! end
!! test
Magic Word: {{PAGELANGUAGE}} on a page with no explicitly set language
+!! options
+parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{PAGELANGUAGE}}
-!! html
+!! html/*
<p>en
</p>
!! end
!! options
thumbsize=220
!! wikitext
-[[File:Foobar.jpg|thumb=Thumb.png|Title]]
+[[File:Foobar.jpg|thumbnail=Thumb.png|Title]]
!! html/php
<div class="thumb tright"><div class="thumbinner" style="width:137px;"><a href="/wiki/File:Foobar.jpg"><img alt="" src="http://example.com/images/e/ea/Thumb.png" width="135" height="135" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>Title</div></div></div>
Some text
===Another headline===
!! html
-<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
+<div id="toc" class="toc"><div id="toctitle" class="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="#Headline_1"><span class="tocnumber">1</span> <span class="toctext">Headline 1</span></a>
<ul>
== Headline 2 ==
== Headline ==
!! html/php
-<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
+<div id="toc" class="toc"><div id="toctitle" class="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="#Headline_2"><span class="tocnumber">1</span> <span class="toctext">Headline 2</span></a></li>
<li class="toclevel-1 tocsection-2"><a href="#Headline"><span class="tocnumber">2</span> <span class="toctext">Headline</span></a></li>
========= Level 9 Heading=========
========== Level 10 Heading==========
!! html
-<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
+<div id="toc" class="toc"><div id="toctitle" class="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="#Level_1_Heading"><span class="tocnumber">1</span> <span class="toctext">Level 1 Heading</span></a>
<ul>
== title 2 ==
=== title 2.1 ===
!! html
-<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
+<div id="toc" class="toc"><div id="toctitle" class="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="#title_1"><span class="tocnumber">1</span> <span class="toctext">title 1</span></a>
<ul>
__FORCETOC__
==<span id="old-anchor"></span>New title==
!! html/php
-<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
+<div id="toc" class="toc"><div id="toctitle" class="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="#New_title"><span class="tocnumber">1</span> <span class="toctext">New title</span></a></li>
</ul>
== title 2 ==
=== title 2.1 ===
!! html
-<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
+<div id="toc" class="toc"><div id="toctitle" class="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="#title_1"><span class="tocnumber">1</span> <span class="toctext">title 1</span></a>
<ul>
====Section 1.1.1.1====
==Section 2==
!! html
-<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
+<div id="toc" class="toc"><div id="toctitle" class="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="#Section_1"><span class="tocnumber">1</span> <span class="toctext">Section 1</span></a>
<ul>
=== title 1.1 ===
== title 2 ==
!! html
-<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
+<div id="toc" class="toc"><div id="toctitle" class="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="#title_1"><span class="tocnumber">1</span> <span class="toctext">title 1</span></a>
<ul>
!! html
<p>The tooltips shall not show entities to the user (ie. be double escaped)
</p>
-<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
+<div id="toc" class="toc"><div id="toctitle" class="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="#text_.3E_text"><span class="tocnumber">1</span> <span class="toctext">text > text</span></a></li>
<li class="toclevel-1 tocsection-2"><a href="#text_.3C_text"><span class="tocnumber">2</span> <span class="toctext">text < text</span></a></li>
!! html
<p>Id should not contain + for spaces
</p>
-<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
+<div id="toc" class="toc"><div id="toctitle" class="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="#Space_between_Text"><span class="tocnumber">1</span> <span class="toctext">Space between Text</span></a></li>
<li class="toclevel-1 tocsection-2"><a href="#Space-Entity_between_Text"><span class="tocnumber">2</span> <span class="toctext">Space-Entity between Text</span></a></li>
=''italic'' heading==
==''italic'' heading=
!! html
-<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
+<div id="toc" class="toc"><div id="toctitle" class="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="#foo.3D"><span class="tocnumber">1</span> <span class="toctext">foo=</span></a></li>
<li class="toclevel-1 tocsection-2"><a href="#.3Dfoo"><span class="tocnumber">2</span> <span class="toctext">=foo</span></a></li>
== Header 2.2 ==
__NOEDITSECTION__
!! html
-<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
+<div id="toc" class="toc"><div id="toctitle" class="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1"><a href="#Header_1"><span class="tocnumber">1</span> <span class="toctext">Header 1</span></a>
<ul>
http://__TOC__
!! html
<h2><span class="mw-headline" id="onmouseover.3D">onmouseover=</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=1" title="Edit section: onmouseover=">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-http://<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
+http://<div id="toc" class="toc"><div id="toctitle" class="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="#onmouseover.3D"><span class="tocnumber">1</span> <span class="toctext">onmouseover=</span></a></li>
</ul>
<h2><span class="mw-headline" id="onmouseover.3D">onmouseover=</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=1" title="Edit section: onmouseover=">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
<p>http://</p>
<div id="toc" class="toc">
-<div id="toctitle">
+<div id="toctitle" class="toctitle">
<h2>Contents</h2>
</div>
<ul>
</div></li>
</ul>
+!! html/parsoid
+<ul class="gallery mw-gallery-traditional" type="123" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","attrs":{"type":"123","summary":"345"},"body":{"extsrc":"\nFile:File:Foobar.jpg\n"}}'>
+<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span style="display: inline-block; height: 100%; vertical-align: middle;"></span><span style="vertical-align: middle; display: inline-block;">File:File:Foobar.jpg</span></div><div class="gallerytext"></div></li>
+</ul>
!! end
## Parsoid thinks the "centre" here is a property, not a caption.
</gallery>
!! end
+!! test
+Gallery with class and style attributes
+!! options
+parsoid={
+ "nativeGallery": true
+}
+!! wikitext
+<gallery class="center" style="text-align: center;">
+File:Foobar.jpg
+</gallery>
+!! html/php
+<ul class="gallery mw-gallery-traditional center" style="text-align: center;">
+ <li class="gallerybox" style="width: 155px"><div style="width: 155px">
+ <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div>
+ <div class="gallerytext">
+ </div>
+ </div></li>
+</ul>
+
+!! html/parsoid
+<ul class="gallery mw-gallery-traditional center" style="text-align: center;" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","attrs":{"class":"center","style":"text-align: center;"},"body":{}}'>
+<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span style="display: inline-block; height: 100%; vertical-align: middle;"></span><span typeof="mw:Image" style="vertical-align: middle; display: inline-block;"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></span></div><div class="gallerytext"></div></li>
+</ul>
+!! end
+
+!! test
+Gallery in slideshow mode
+!! options
+parsoid={
+ "nativeGallery": true
+}
+!! wikitext
+<gallery mode="slideshow" showthumbnails="">
+File:Foobar.jpg
+</gallery>
+!! html/php
+<ul class="gallery mw-gallery-slideshow" data-showthumbnails="1">
+ <li class="gallerybox" style="width: 155px"><div style="width: 155px">
+ <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div>
+ <div class="gallerytext">
+ </div>
+ </div></li>
+</ul>
+
+!! html/parsoid
+<ul class="gallery mw-gallery-slideshow" data-showthumbnails="1" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","attrs":{"mode":"slideshow","showthumbnails":""},"body":{}}'>
+<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px;"><span typeof="mw:Image"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></span></div><div class="gallerytext"></div></li>
+</ul>
+!! end
+
!! test
HTML Hex character encoding (spells the word "JavaScript")
!! options
=====5=====
==2==
!! html
-<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
+<div id="toc" class="toc"><div id="toctitle" class="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="#2"><span class="tocnumber">1</span> <span class="toctext">2</span></a>
<ul>
!! wikitext
<indicator name=" "></indicator>
<indicator></indicator>
-!! html
+!! html/php
<p><span class="error"><strong>Error:</strong> Page status indicators' <code>name</code> attribute must not be empty.</span>
<span class="error"><strong>Error:</strong> Page status indicators' <code>name</code> attribute must not be empty.</span>
</p>
!! wikitext
<indicator name="empty" />
<indicator name="name"></indicator>
-!! html
+!! html/php
empty=
name=
<p><br />
<indicator name="10">Two
paragraphs</indicator>
-!! html
+!! html/php
01=hello world
02=<a href="/wiki/Main_Page" title="Main Page">Main Page</a>
03=<img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/25px-Foobar.jpg" width="25" height="3" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/38px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg 2x" />
__TOC__
== ''Lost'' episodes ==
!! html
-<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
+<div id="toc" class="toc"><div id="toctitle" class="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="#Lost_episodes"><span class="tocnumber">1</span> <span class="toctext"><i>Lost</i> episodes</span></a></li>
</ul>
__TOC__
== '''should be bold''' then normal text ==
!! html
-<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
+<div id="toc" class="toc"><div id="toctitle" class="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="#should_be_bold_then_normal_text"><span class="tocnumber">1</span> <span class="toctext"><b>should be bold</b> then normal text</span></a></li>
</ul>
__TOC__
== Image [[Image:foobar.jpg]] ==
!! html
-<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
+<div id="toc" class="toc"><div id="toctitle" class="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="#Image"><span class="tocnumber">1</span> <span class="toctext">Image</span></a></li>
</ul>
__TOC__
== <blockquote>Quote</blockquote> ==
!! html
-<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
+<div id="toc" class="toc"><div id="toctitle" class="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="#Quote"><span class="tocnumber">1</span> <span class="toctext">Quote</span></a></li>
</ul>
!! html+tidy
<p></p>
<div id="toc" class="toc">
-<div id="toctitle">
+<div id="toctitle" class="toctitle">
<h2>Contents</h2>
</div>
<ul>
<small>Hanc marginis exiguitas non caperet.</small>
QED
!! html
-<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
+<div id="toc" class="toc"><div id="toctitle" class="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="#Proof:_2_.3C_3"><span class="tocnumber">1</span> <span class="toctext">Proof: 2 < 3</span></a></li>
</ul>
== <i>Foo</i> <blockquote>Bar</blockquote> ==
!! html
-<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
+<div id="toc" class="toc"><div id="toctitle" class="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="#Foo_Bar"><span class="tocnumber">1</span> <span class="toctext"><i>Foo</i> <b>Bar</b></span></a></li>
<li class="toclevel-1 tocsection-2"><a href="#Foo_Bar_2"><span class="tocnumber">2</span> <span class="toctext"><i>Foo</i> Bar</span></a></li>
!! html+tidy
<p></p>
<div id="toc" class="toc">
-<div id="toctitle">
+<div id="toctitle" class="toctitle">
<h2>Contents</h2>
</div>
<ul>
== <sup class="a > b">Evilbye</sup> ==
!! html/php
-<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
+<div id="toc" class="toc"><div id="toctitle" class="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="#Hello"><span class="tocnumber">1</span> <span class="toctext"><sup>Hello</sup></span></a></li>
<li class="toclevel-1 tocsection-2"><a href="#b.22.3EEvilbye"><span class="tocnumber">2</span> <span class="toctext"><sup> b">Evilbye</sup></span></a></li>
== <span dir="ltr" style="font-style: italic">Attributes after dir on these span tags must be deleted from the TOC</span> ==
!! html
-<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
+<div id="toc" class="toc"><div id="toctitle" class="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="#C.2B.2B"><span class="tocnumber">1</span> <span class="toctext"><span dir="ltr">C++</span></span></a></li>
<li class="toclevel-1 tocsection-2"><a href="#.D7.96.D7.91.D7.A0.D7.92.21"><span class="tocnumber">2</span> <span class="toctext"><span dir="rtl">זבנג!</span></span></a></li>
__TOC__
== <bdi>test</bdi> ==
!! html
-<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
+<div id="toc" class="toc"><div id="toctitle" class="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="#test"><span class="tocnumber">1</span> <span class="toctext"><bdi>test</bdi></span></a></li>
</ul>
__TOC__
== <s>test</s> test <strike>test</strike> ==
!! html
-<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
+<div id="toc" class="toc"><div id="toctitle" class="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="#test_test_test"><span class="tocnumber">1</span> <span class="toctext"><s>test</s> test <strike>test</strike></span></a></li>
</ul>
__TOC__
== x ==
!! html
-<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
+<div id="toc" class="toc"><div id="toctitle" class="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="#x"><span class="tocnumber">1</span> <span class="toctext">x</span></a></li>
</ul>
!! html+tidy
<p></p>
<div id="toc" class="toc">
-<div id="toctitle">
+<div id="toctitle" class="toctitle">
<h2>Contents</h2>
</div>
<ul>
## recognized as an extension tag w/o a native handler.
!! test
LST Sections: Newfangled approach
-!! options
-parsoid={ "suppressErrors": true }
!! wikitext
<section begin="2011-05-16" />
<section end="2014-04-10 (MW 1.23wmf22)" />
!! html/parsoid
-<p><span typeof="mw:Extension/section" about="#mwt1" data-parsoid='{"stx":"html","selfClose":true,"src":"<section begin=\"2011-05-16\" />","tagWidths":[30,0]}'><section begin="2011-05-16" /></span>
-<span typeof="mw:Extension/section" about="#mwt2" data-parsoid='{"stx":"html","selfClose":true,"src":"<section end=\"2014-04-10 (MW 1.23wmf22)\" />","tagWidths":[43,0]}'><section end="2014-04-10 (MW 1.23wmf22)" /></span></p>
+<p><span typeof="mw:Error mw:Extension/section" about="#mwt1" data-mw='{"name":"section","attrs":{"begin":"2011-05-16"},"body":null,"errors":[{"key":"mw-api-extexpand-error","message":"Could not expand extension source."}]}'><section begin="2011-05-16" /></span>
+<span typeof="mw:Error mw:Extension/section" about="#mwt2" data-mw='{"name":"section","attrs":{"end":"2014-04-10 (MW 1.23wmf22)"},"body":null,"errors":[{"key":"mw-api-extexpand-error","message":"Could not expand extension source."}]}'><section end="2014-04-10 (MW 1.23wmf22)" /></span></p>
!! end
#--------- Test stripping of empty nodes in template content ----------
parsoid=html2wt
!! html/parsoid
<p><a rel="mw:ExtLink" href="http://google.com">[google]</a>
-<a rel="mw:ExtLink" href="http://google.com">google]</a></p>
+<a rel="mw:ExtLink" href="http://google.com">google]</a>
+<a rel="mw:ExtLink" href="http://google.com">goog] le</a></p>
<p>[http://google.com]</p>
<p>[http://google.com google]</p>
<p>[<a rel="mw:ExtLink" href="http://google.com">http://google.com</a>]</p>
!! wikitext
[http://google.com <nowiki>[google]</nowiki>]
[http://google.com <nowiki>google]</nowiki>]
+[http://google.com <nowiki>goog] le</nowiki>]
<nowiki>[http://google.com]</nowiki>
!! html/php
<p><a rel="nofollow" class="external text" href="http://google.com">[google]</a>
<a rel="nofollow" class="external text" href="http://google.com">google]</a>
+<a rel="nofollow" class="external text" href="http://google.com">goog] le</a>
</p><p>[http://google.com]
</p><p>[http://google.com google]
</p><p>[<a rel="nofollow" class="external free" href="http://google.com">http://google.com</a>]
!! test
4. No escaping needed
!! options
-options=html2wt
+parsoid=html2wt
!! html/parsoid
<p>'<span><i>bar</i></span>'
'<span><b>bar</b></span>'
!! test
4. Leading whitespace in indent-pre suppressing contexts should not be escaped
!! options
-options=html2wt
+parsoid=html2wt
!! html/parsoid
<figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="25" width="220"/></a><figcaption>caption</figcaption></figure>
!! wikitext
# Tests spec'ing wikitext serialization norms |
# --------------------------------------------
+!! test
+Serialize multi-line indent-pre starting with wikitext syntax
+!! options
+parsoid=html2wt
+!! html/parsoid
+<pre>* 1
+** 2
+* 3</pre>
+!! wikitext
+ * 1
+ ** 2
+ * 3
+!! end
+
!! test
1. Categories should always be serialized on their own line
!! options
|}
!! end
+!! test
+Anchor without href scenarios
+!! options
+parsoid={ "modes": ["html2wt"], "suppressErrors": true }
+!! html/parsoid
+<a class="bc"></a>
+<a class="no">dice</a>
+<a name="foo"></a>
+!! wikitext
+
+dice
+<span name="foo"></span>
+!! end
+
# -----------------------------------------------------------------
# End of section for Parsoid-only html2wt tests for serialization
# of new content