# 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 # MediaWiki Parser test cases # Some taken from https://meta.wikimedia.org/wiki/Parser_testing # All (C) their respective authors and released under the GPL # # The syntax should be fairly self-explanatory. # # Currently supported test options: # One of the following modes: # # (default) generate HTML output # pst apply pre-save transform # msg apply message transform # comment run through MediaWiki\CommentFormatter\CommentFormatter::format() instead of main parser # # Options for adding metadata to the output: # # cat add category links # (ignored by Parsoid, since it emits s) # ill add inter-language links # (ignored by Parsoid, since it emits s) # property=XXX add the value of the page property with the given name. # This can also be a comma-separated list. # extension=XXX add the JSON-encoded value of the given extension data. # This can also be a comma-separated list. # showtitle make the first line the title # showindicators make the first lines the page status indicators # # Parser parameters: # # subpage enable subpages (disabled by default) # title=[[XXX]] run test using article title XXX # language=XXX set content language to XXX for this test # variant=XXX set the variant of language for this test (eg zh-tw) # notoc disable table of contents # thumbsize=NNN set the default thumb size to NNNpx for this test # wrap include the normal wrapper
(since 1.30) # local format section links in edit comment text as local links # # Configuration globals: # # wgEnableUploads, wgAllowExternalImages, wgMaxTocLevel, # wgLinkHolderBatchSize, wgRawHtml, wgInterwikiMagic, # wgEnableMagicLinks # # Test execution options: # # disabled do not run test # parsoid parsoid-specific options (not run by PHP parser unless # the test includes an html/php section) # php php-only test (not run by the parsoid parser unless # the test includes an html/parsoid section) # # For testing purposes, temporary articles can created: # !!article / NAMESPACE:TITLE / !!text / ARTICLE TEXT / !!endarticle # where '/' denotes a newline. # This is the standard article assumed to exist. !! article Main Page !! text blah blah !! endarticle !!article Foo !!text FOO !!endarticle !!article Foo''s bar''s !!text Article titles can contain single quotes! !!endarticle !!article Template:Foo !!text FOO !!endarticle !! article Template:redirect to foo !! text #REDIRECT [[Template:Foo]] !! endarticle !! article Template:Blank !! text !! endarticle !! article Template:pipe !! text | !! endarticle !! article Template:= !! text = !! endarticle !! article Template:inner list !! text * item 1 !! endarticle !! article Template:tbl-start !! text {| !! endarticle !! article Template:tbl-end !! text |} !! endarticle !! article Template:table_attribs_3 !! text |style{{=}}"background:#f9f9f9;"|Foo !! endarticle !! article Template:table_attribs_6 !! text style="background: red;" | !! endarticle !! article Template:1x !! text {{{1}}} !! endarticle # For is; localize Template namespace !! article Snið:1x !! text {{{1}}} !! endarticle !! article Template:3x_on_newline !! text {{{1}}} {{{1}}} {{{1}}} !! endarticle !! article Template:1x_with_span !! text {{{1}}} !! endarticle !! article Template:1x_with_div !! text
{{{1}}}
!! endarticle !! article Template:1x with depth !! text {{1x|{{{1}}}}} !! endarticle !! article Template:blank_param !! text {{{1}}} {{{}}} !! endarticle !! article Template:PartialTable !! text {| |- !! endarticle ## See T48811 for details !! article Template:mixed_attr_content_template !! text style="color:red;" title="T48811" |- |foo !! endarticle ## This template has a category in fosterable position. See T249740 for details !! article Template:mixed_attr_content_template_2 !! text style="color:red;" title="T249740" |- [[Category:Fostered Content]] |foo !! endarticle !! article A?b !! text Weirdo titles! !! endarticle !!article Template:Bullet !!text *Bar !!endarticle !!article Template:OpenTable !!text {| !!endarticle !!article Template:EmptyLITest !!text *a * * *b !!endarticle !!article Template:EmptyTRTest !!text {| |- |- |foo |- |- |bar |} !!endarticle !!article Template:EmptyTRWithHTMLAttrTest !!text
foo
bar
!!endarticle !! article Template:With: Colon !! text Template with colon !! endarticle !! article Template:Template with pagename !! text This is {{PAGENAME}}. !! endarticle !! article File:Redirect to foobar.jpg !! text #REDIRECT[[File:Foobar.jpg]] !! endarticle ### ### Basic tests ### !! test Blank input !! wikitext !! html !! end !! test Simple paragraph !! wikitext This is a simple paragraph. !! html

This is a simple paragraph.

!! end !! test Paragraphs with extra newline spacing !! wikitext a b (+2 nls) c (+3 nls) d (+4 nls) e (+5 nls) !! html

a

b (+2 nls)


c (+3 nls)


d (+4 nls)



e (+5 nls)

!! end !! test Paragraphs with newline spacing with comment lines in between !! wikitext ---- a b ---- a b ---- a b ---- a b ---- a b ---- a b ---- a b ---- !! html

a b


a b


a b


a

b


a

b


a


b


a


b


!! end !! test Paragraphs with newline spacing with non-empty white-space lines in between !! wikitext ---- a b ---- a b ---- !! html

a

b


a


b


!! end !! test Paragraphs with newline spacing with non-empty mixed comment and white-space lines in between !! wikitext ---- a b ---- a b ---- a b ---- a b ---- !! html

a b


a b


a

b


a


b


!! end !! test Extra newlines: More paragraphs with indented comment !! wikitext a b !! html

a


b

!!end !! test Extra newlines followed by heading !! wikitext a =b= [[a]] =b= !! html

a


b[edit]

a


b[edit]

!! end !! article A !! text Dummy article to suppress redlinks in tests !! end !! test Extra newlines between heading and content are swallowed (Parsoid does not) !! wikitext =b= [[a]] !! html/php

b[edit]

a

!! html/parsoid

b


a

!! end !! test Extra new lines before and after lists are preserved !! wikitext a *b c !! html/php

a



c

!! html/parsoid

a



c

!! end # Parsoid regression test !!test Multiple newlines after tables are converted to p-br-p tags !!options parsoid=wt2html,wt2wt !!wikitext {| |x |} =b= !!html/php
x



b[edit]

!!html/parsoid
x



b

!!end !! test Heading with line break in nowiki !! options parsoid=wt2html !! config wgFragmentMode=[ "html5", "legacy" ] !! wikitext ==A B C== !! html/php

A B C[edit]

!! html/parsoid

A B C

!! end !! test Heading with nonbreaking space in prefix/suffix (T235684) !! options parsoid=wt2html,html2html !! config wgFragmentMode=[ "html5", "legacy" ] !! wikitext ==   A   B   == !! html/php

  A   B  [edit]

!! html/parsoid

  A   B  

!! end !! test Parsing an URL !! wikitext http://fr.wikipedia.org/wiki/🍺 !! html

http://fr.wikipedia.org/wiki/🍺

!! end !! test Simple list !! wikitext *Item 1 *Item 2 !! html !! end ### ### Non-html5 tags ### ## The attribute on the font tag is so Parsoid won't normalize it away !! test Non-html5 tags should be accepted !! wikitext
''foo''
''foo'' ''foo'' ''foo'' ''foo'' !! html
foo

foo foo foo foo

!! end !! test is valid wikitext (T54468) !! wikitext !! html

!! end # is HTML4, is HTML4/5. !! test or for strikethrough !! wikitext strike s !! html

strike

s

!! end ## a not permitted ## i,b,br omitted !! test Text-level semantic html elements in wikitext !! wikitext text text text text text text text text text text text text text text text text 明日(Ashita あした) text text text !! html

text text text text text text text text text text text text text text text text 明日(Ashita あした) text text text

!! end # test cases taken from # https://www.w3.org/TR/html5/text-level-semantics.html#the-ruby-element !! test Ruby markup (W3C-style) !! wikitext ;Mono-ruby for individual base characters :ほん ;Group ruby :今日きょう ;Jukugo ruby :きょう ;Inline ruby :(とうきょう) ;Double-sided ruby :jiùjīnshānSan Francisco HeartCœur ShamrockTrèfle StarÉtoile !! html
Mono-ruby for individual base characters
ほん
Group ruby
今日きょう
Jukugo ruby
きょう
Inline ruby
(とうきょう)
Double-sided ruby
jiùjīnshānSan Francisco

HeartCœur ShamrockTrèfle StarÉtoile

!! end # The next two test different paths in the sanitizer. !! test Non-word characters don't terminate tag names (T19663, T42670, T54022) !! wikitext a doesn't terminate doesn't terminate doesn't terminate doesn't terminate !! html

<blockquote|>a

<b→> doesn't terminate </b→>

<bä> doesn't terminate </bä>

<boo> doesn't terminate </boo>

<s.foo> doesn't terminate </s.foo>

<sub-ID#1>

!! end ### ### See tests/parser/ParserTestParserHook.php for the extension) ### This checks that HTML5 tags (with non-word characters in the tag ### name) make it safely through the parser -- the Sanitizer will ### munge them later, as it should. ### !! test Non-word characters are valid in extension tags (T19663) !! wikitext tåg !! html/php
'tåg'
array (
)
!! html/parsoid
'tåg'
array (
)
!! end !! test Isolated close tags should be treated as literal text (T54760) !! options parsoid=wt2html !! wikitext s
!! html

<s.foo>s

!! end !! test Self-closed tag hooks !! wikitext


!! html/php


!! html/parsoid


!! end ### ### Special characters ### !! test Bare pipe character (T54363) !! wikitext | !! html

|

!! end !! test Bare pipe character from a template (T54363) !! wikitext {{pipe}} !! html

|

!! end !! test Implicit newline insertion/sol when expanding templates (T241150/T14974/T2529) !! wikitext {{1x|#foo}}{{1x|#foo}} !! html/php
  1. foo
  2. foo
!! html/parsoid
  1. foo
  2. foo
!! end ### ### test cases ### !! test unordered list !! wikitext * This is not an unordered list item. !! html/php

* This is not an unordered list item.

!! html/parsoid

* This is not an unordered list item.

!! end !! test spacing !! wikitext Lorem ipsum dolor sed abit. sed nullum. :and a colon !! html/php

Lorem ipsum dolor sed abit. sed nullum. :and a colon

!! html/parsoid

Lorem ipsum dolor sed abit. sed nullum. :and a colon

!! end !! test Don't parse (T149622) !! wikitext !! html/php

<span class="error">

!! html/parsoid

<span class="error">

!! end !! test nowiki 3 !! wikitext :There is not nowiki. :There is nowiki. #There is not nowiki. #There is nowiki. *There is not nowiki. *There is nowiki. !! html/php
There is not nowiki.
There is nowiki.
  1. There is not nowiki.
  2. There is nowiki.
  • There is not nowiki.
  • There is nowiki.
!! html/parsoid
There is not nowiki.
There is nowiki.
  1. There is not nowiki.
  2. There is nowiki.
  • There is not nowiki.
  • There is nowiki.
!! end !! test Entities inside !! wikitext < !! html/php

<

!! html/parsoid

<

!! end !! test Entities inside template parameters !! wikitext {{1x|–}} !! html/php

!! html/parsoid

!! end !! test Properly escape nowiki when combined with other wiki markup !! options parsoid=html2wt !! html/parsoid

* </nowiki> tag

!! wikitext * </nowiki> tag !! end !! test T93824: Put escaped HTML tags inside nowiki !! options parsoid=html2wt !! html/parsoid

<h2>foo</h2>

!! wikitext

foo

!! end !! test T71950: 1. Put nowiki as close to cause as possible, even with non-quote escapable chars !! options parsoid=html2wt !! html/parsoid

This text: L'Foo This text: L''Foo This text: L'''Foo''

!! wikitext This text: L'[[Foo]] This text: L''[[Foo]] This text: L'''[[Foo]]'' !! end !! test T71950: 2. Put nowiki as close to cause as possible, after ' :' !! options parsoid=html2wt !! html/parsoid

This text : L''Foo

!! wikitext This text : L''[[Foo]] !! end # This test and the next one are html2wt only as they test that incorrect wikitext # passed in template arguments gets escaped or wrapped in nowikis where required. !! test T71482: Use {{!}} instead of nowiki for single pipe in template argument !! options parsoid=html2wt !! html/parsoid

!! wikitext {{1x|foo{{!}}bar}} {{1x|foo|bar |[[}} !! end !! test T53961: Output correct nowikis in template arguments !! options parsoid=html2wt !! html/parsoid

!! wikitext {{1x|a [ b}} {{1x|a }} b}} {{1x|a [[ b}} {{1x|a | {{ ]]}} {{1x|a }}} !! end !! test Cases where "!!" needs nowiki protection !! options parsoid=html2wt !! html/parsoid
this needs protection !! here
this does not need protection !! here
!! wikitext {| !this needs protection !! here |} {| !this does not need protection !! here |} !! end !! test Nowiki with newlines in list !! wikitext :test 123 !! html/php
test 123
!! html/parsoid
test 123
!! end ## The output here may change with the outcome of T255007 !! test Nowiki and french spacing !! wikitext test : 123 !! html/php

test : 123

!! html/parsoid

test : 123

!! end !! test T255007: French spacing in raw text elements !! options wgRawHtml=1 !! wikitext !! html/php

!! html/parsoid

!! end !! article Test !! text Dummy article to suppress redlinks in tests !! end !! test French spacing and spans !! wikitext [[Test]] : 123 « Test »123 !! html/php

Test : 123 « Test »123

!! html/parsoid

Test : 123 « Test »123

!! end !! test post-expand include size being exceeded !! options maxincludesize=30 !! wikitext {{3x_on_newline|1234567890}} !! html/php

Template:3x on newline

!! html/parsoid+integrated

Template:3x on newline

!! end !! test max template depth being reached !! options maxtemplatedepth=1 !! wikitext {{1x with depth|too deep!}} !! html/php

Template recursion depth limit exceeded (1)

!! html/parsoid+integrated

Template recursion depth limit exceeded (1)

!! end !! test multiple templates that are redirects !! wikitext {{redirect to foo}} {{redirect to foo}} !! html/php

FOO FOO

!! html/parsoid+integrated

FOO FOO

!! end !! test T53086: Double newlines in blockquotes should be turned into paragraphs !! wikitext
Foo Bar
!! html

Foo

Bar

!! end !! test T17491: / in blockquote !! wikitext
Foo bar baz quux
!! html

Foo bar baz quux

!! end !! test T17491: / in blockquote (2) !! wikitext
Foo bar baz quux
!! html

Foo bar baz quux

!! end # Regression test to prevent problematic simplifications of parser tests !! test Don't paragraph-wrap empty newlines between HTML list items !! options parsoid=wt2html !! wikitext
  1. foo
  2. foo
!! html/php
  1. foo
  2. foo
!! html/parsoid
  1. foo
  2. foo
!! end #-------------------------------------------------------------------- # Transclusion parameter whitespace stripping tests # Behavior is different for positional and named parameters #-------------------------------------------------------------------- !! test Templates: Strip leading and trailing whitespace from named-param values !! wikitext {{1x|1= a }} {{1x|1= {{1x|b}} }} {{1x| 1 = c }} {{1x| 1 = * d }} !! html

a

b

c

  • d
!! end !! test Templates: Don't strip whitespace from positional-param values !! wikitext {{1x|a }} {{1x|{{1x|b}} }} {{1x| c }} {{1x| {{1x|d}} }} {{1x| e}} {{1x| *f}} {{1x| }}g !! html

a

b

c 


d


e


  • f


g
!! html/parsoid

a

b

c 
d
e
  • f
g
!! end !! test Templates: Don't recognize targets split by newlines !! options parsoid=wt2html !! wikitext {{ech o|foo}} !! html/php

{{ech o|foo}}

!! html/parsoid

{{ech o|foo}}

!! end !! test Templates: Recognize targets when newlines and comments don't split the target !! options parsoid=wt2html !! wikitext {{ 1x |foo}} !! html/php

foo

!! html/parsoid

foo

!! end ## wt2html only, since the bare {{ will get escaped when serializing !! test Templates: Target with an extension tag !! options parsoid=wt2html !! wikitext {{{{1x|1x}}hi|ho}} !! html/php

{{1xhi|ho}}

!! html/parsoid

{{1xhi|ho}}

!! end !! test Templates: Handle empty comment-and-ws-only lines correctly !! wikitext {{1x|foo bar}} !! html/php

foo bar

!! html/parsoid+standalone

foo bar

!! html/parsoid+integrated

foo bar

!! end !! test Templates: Handle comments in the target !! wikitext {{1x |foo}} {{1x |foo}} {{1x |foo}} {{1x|foo}} {{1x|foo}} !! html/php

foo

foo

foo

foo

foo

!! html/parsoid

foo

foo

foo

foo

foo

!! end !! test Templates: Handle comments in parameter names (T69657) !! wikitext {{1x|1 =foo}} {{1x| 1 = foo}} {{1x|1=foo}} {{1x|1=foo}} !! html/php

foo

foo

foo

foo

!! html/parsoid

foo

foo

foo

foo

!! end !! test Templates: Other wikitext in parameter names (T69657) !! wikitext {{1x|''1''=foo}} !! html/php

{{{1}}}

!! html/parsoid+integrated

{{{1}}}

!! end !! test Templates: With colons !! wikitext {{With: Colon}} !! html/php

Template with colon

!! html/parsoid

Template with colon

!! end #-------------------------------------------------------------------- # Transclusion parameter escaping tests #-------------------------------------------------------------------- !! test Templates: Parsoid parameter escaping test 1 !! wikitext {{1x|[foo]|{{1x|[bar]}}}} !! html/php

[foo]

!! html/parsoid

[foo]

!! end !! test Parsoid: Pipes in external links in template parameter !! wikitext {{1x|[{{1x|http://example.com}} link]}} !! html/php

link

!! html/parsoid

link

!! end !! test Parsoid: pipe in transclusion parameter !! wikitext {{1x|http://foo.com/a|b}} !! html/php

http://foo.com/a%7Cb

!! html/parsoid

http://foo.com/a%7Cb

!! end !! test Parsoid: Pipe in external link target and content in template parameter !! options parsoid=html2wt,wt2wt !! wikitext {{1x|[http://foo.com/a|b a|b]}} !! html/php

a|b

!! html/parsoid

a|b

!! end !! test Parsoid: Pipe in template with nested template in external link target in template parameter (seriously) !! wikitext {{1x|[{{fullurl:{{FULLPAGENAME}}|action=edit}} bar]}} !! html/php

bar

!! html/parsoid

bar

!! end !! test Templates: Don't escape already nowiki-escaped text in template parameters !! options parsoid=html2wt,wt2wt !! wikitext {{1x|foo|bar}} {{1x|<div>}} {{1x|}} !! html/php

foo|bar <div>

!! html/parsoid

foo|bar <div>

!! end ## T54824 !! test Templates: '=' char in nested transclusions should not trigger nowiki escapes or conversion to named param !! options parsoid=html2wt,wt2wt !! wikitext {{1x|{{1x|1=bar}}}} !! html/php

bar

!! html/parsoid

bar

!! end ## T58733 !! test Templates parameters with special tokenizing behavior dont get modified because of arg escaping !! wikitext {{1x|a : b}} !! html/php

a : b

!! html/parsoid

a : b

!! end ## T73412 !! test Templates: Preserve blank parameter names !! wikitext {{1x|=foo}} !! html/php

{{{1}}}

!! html/parsoid

{{{1}}}

!! end !! test Templates: Preserve blank parameter names in other positions !! wikitext {{blank_param|bar|=foo}} !! html/php

bar foo

!! html/parsoid

bar foo

!! end # wt2html only because Parsoid would want to add s coming from html !! test Broken wikilinks (but not external links) prevent templates from closing !! options parsoid=wt2html !! wikitext [http://example.com x {{1x|[http://example.com x}} [[Foo {{1x|[[Foo}} !! html/php

[http://example.com x

[http://example.com x

[[Foo

{{1x|[[Foo}}

!! html/parsoid

[http://example.com x

[http://example.com x

[[Foo

{{1x|[[Foo}}

!! end !! test Wikilinks with embedded newlines are not broken !! wikitext {{1x|[[ Foo B C]]}} !! html/php

[[ Foo B C]]

!! html/parsoid

[[ Foo B C]]

!! end !! test Broken templates !! options parsoid=wt2html !! wikitext {{1x|[[Foo|}}]] [[Foo|{{1x|]]}} !! html/php

{{1x|}}

[[Foo|]]

!! html/parsoid

{{1x|}}

[[Foo|]]

!! end !! article Template:pipe page !! text Main|Page !! endarticle ## FIXME: Parsoid doesn't support this and may never. See T226523 !! test Template returning pipe used in wikilink target !! wikitext [[{{pipe page}}]] !! html/php

Page

!! html/parsoid

[[Main|Page]]

!! end # Italic/link nesting is changed in this test, but the rendered result is the # same. Currently the Parsoid result is actually an improvement over # the legacy parser output. !! test T4702: Mismatched , and tags are invalid !! wikitext ''[http://example.com text''] [http://example.com '''text]''' ''Something [http://example.com in italic''] ''Something [http://example.com mixed''''', even bold]''' '''''Now [http://example.com both'''''] !! html/php

text text Something in italic Something mixed, even bold Now both

!! html/parsoid

text text Something in italic Something mixed, even bold' Now both

!! end !! test Serialize tags with invalid link targets as plain text !! options parsoid={ "modes": ["html2wt"], "suppressErrors": true } !! html/parsoid text *text [[foo]] *a [[foo]] !! wikitext text *text [[foo]] *a [[foo]] !! end !! test mw:ExtLink -vs- mw:WikiLink (T94723) !! options parsoid=html2wt !! html/parsoid Bar Bar Bar Bar

European Robin European Robin

!! wikitext [[Foo|Bar]] [[Foo|Bar]] [[:en:Foo|Bar]] [[:en:Foo|Bar]] [[:en:European_Robin|European Robin]] [[:en:European_Robin|European Robin]] !! end !! test Break on | in element attribute in template !! options parsoid=wt2html,html2html !! wikitext {{1x|1=
ha
}} !! html/php

ho">ha

!! html/parsoid

ho">ha

!! end !! test Break on | in element attribute name in template !! wikitext {{1x|
ha
}} !! html/parsoid

<div cla

!! end !! test Don't break on | in extension attribute in template !! wikitext {{1x|ha}} !! html/parsoid

[1]

!! end ### ### Internal links ### !! test Plain link, capitalized !! wikitext [[Main Page]] !! html

Main Page

!! end !! test Plain link, uncapitalized !! wikitext [[main Page]] !! html

main Page

!! end !! test Piped link !! wikitext [[Main Page|The Main Page]] !! html

The Main Page

!! end !! test Piped link with comment in link text !! wikitext [[Main Page|The Main Page]] !! html

The Main Page

!! end !! test Piped link with multiple pipe characters in link text !! wikitext [[Main Page||The|Main|Page|]] !! html/php

|The|Main|Page|

!! html/parsoid

|The|Main|Page|

!! end !! test Piped link with no link text !! wikitext [[Thomas Bek (bishop of St David's)|]] !! html/php

[[Thomas Bek (bishop of St David's)|]]

!! html/parsoid

[[Thomas Bek (bishop of St David's)|]]

!! end !! test Piped link with empty link text !! wikitext [[Main Page|]] - empty nowiki [[Main Page| ]] - empty non breaking space !! html/php

- empty nowiki   - empty non breaking space

!! html/parsoid

- empty nowiki   - empty non breaking space

!! end ## Separate from the above because Parsoid normalizes the empty link away !! test Piped link with empty link text - 2 !! options parsoid=wt2html !! wikitext [[Main Page| ]] - empty space !! html/php

- empty space

!! html/parsoid

- empty space

!! end !! test Broken link !! wikitext [[Zigzagzogzagzig]] !! html/php

Zigzagzogzagzig

!! html/parsoid

Zigzagzogzagzig

!! end # The PHP parser strips the hash fragment for non-existent pages, but # Parsoid does not. (T227693) !! test Broken link with fragment !! wikitext [[Zigzagzogzagzig#zug]] !! html/php

Zigzagzogzagzig#zug

!! html/parsoid

Zigzagzogzagzig#zug

!! end !! test Special page link with fragment !! wikitext [[Special:Version#anchor]] !! html

Special:Version#anchor

!! end # Parsoid does not strip fragment from red links: T227693 !! test Nonexistent special page link with fragment !! wikitext [[Special:ThisNameWillHopefullyNeverBeUsed#anchor]] !! html/php

Special:ThisNameWillHopefullyNeverBeUsed#anchor

!! html/parsoid

Special:ThisNameWillHopefullyNeverBeUsed#anchor

!! end !! test Link with prefix !! wikitext xxx[[main Page]], xxx[[Main Page]], Xxx[[main Page]] XXX[[main Page]], XXX[[Main Page]] !! html

xxxmain Page, xxxMain Page, Xxxmain Page XXXmain Page, XXXMain Page

!! end !! test Link with suffix !! wikitext [[Main Page]]xxx, [[Main Page]]XXX, [[Main Page]]!!! !! html

Main Pagexxx, Main PageXXX, Main Page!!!

!! end !! article prefixed article !! text Some text !! endarticle !! test T45661: Piped links with identical prefixes !! wikitext [[prefixed article|prefixed articles with spaces]] [[prefixed article|prefixed articlesaoeu]] [[Main Page|Main Page test]] !! html

prefixed articles with spaces

prefixed articlesaoeu

Main Page test

!! end !! test Link with HTML entity in suffix / tail !! wikitext [[Main Page]]", [[Main Page]]a !! html/php

Main Page", Main Pagea

!! html/parsoid

Main Page", Main Pagea

!! end !! test Link with 3 brackets !! wikitext [[[Main Page]]] Foo [[[Main Page]]] !! html

[[[Main Page]]] Foo [[[Main Page]]]

!! end !! test Link with 4 brackets !! wikitext [[[[Main Page]]]] !! html

[[Main Page]]

!! end !! test Piped link with 3 brackets !! wikitext [[[main page|the main page]]] !! html

[[[main page|the main page]]]

!! end !! test Piped link with extlink-like text !! wikitext [[Main Page|[bar]]] [[Main Page|This is a [bar]]] [[Main Page|[bar]] !! html/php

[bar] This is a [bar] [bar

!! html/parsoid

[bar] This is a [bar] [bar

!! end !! test Link with multiple pipes !! wikitext [[Main Page|The|Main|Page]] !! html

The|Main|Page

!! end !! test Anchor containing a #. (T65430) !! config wgFragmentMode=[ "html5", "legacy" ] !! wikitext [[Main Page#And#Link]] !! html/php

Main Page#And#Link

!! html/parsoid

Main Page#And#Link

!! end !! article Talk:Parser testing !! text Dummy article to suppress redlinks in tests !! end !! article Meta:Disclaimers !! text Dummy article to suppress redlinks in tests !! end !! test Link to namespaces !! wikitext [[Talk:Parser testing]], [[Meta:Disclaimers]] !! html/php

Talk:Parser testing, Meta:Disclaimers

!! html/parsoid

Talk:Parser testing, Meta:Disclaimers

!! end !! article User talk:Foo bar !! text Dummy article to suppress redlinks in tests !! end !! test Link with space in namespace !! wikitext [[User talk:Foo bar]] !! html/php

User talk:Foo bar

!! html/parsoid

User talk:Foo bar

!! end !! article MemoryAlpha:AlphaTest !! text This is an article in the MemoryAlpha namespace (which shadows the memoryalpha interwiki link). !! endarticle !! test Namespace takes precedence over interwiki link (T53680) !! wikitext [[MemoryAlpha:AlphaTest]] !! html

MemoryAlpha:AlphaTest

!! end # The previous test doesn't work correctly in html2*, due to not recognizing the # link as an internal one. This one checks for the correct behavior. !! test Link to namespace preferred over interwiki with correct rel attribute !! options parsoid=html2wt,html2html !! html/parsoid

MemoryAlpha:AlphaTest

!! wikitext [[MemoryAlpha:AlphaTest]] !! end !! test Piped link to namespace !! wikitext [[Meta:Disclaimers|The disclaimers]] !! html/php

The disclaimers

!! html/parsoid

The disclaimers

!! end !! test Link containing } !! wikitext [[Usually caused by a typo (oops}]] !! html

[[Usually caused by a typo (oops}]]

!! end !! article 7% Solution !! text Just a test of an article title containing a percent. !! endarticle !! test Link containing % (not as a hex sequence) !! wikitext [[7% Solution]] [[7% Solution|7%25 Solution]] !! html/php

7% Solution 7%25 Solution

!! html/parsoid

7% Solution 7%25 Solution

!! end # note that the parsoid HTML is identical to the previous test output, # so the previous test ensures that the html2wt mode will generate the # "not as a hex sequence" wikitext. !! test Link containing % as a single hex sequence interpreted to char !! options parsoid=wt2wt,wt2html,html2html !! wikitext [[7%25 Solution]] [[7%25 Solution|7%25 Solution]] !! html/php

7% Solution 7%25 Solution

!! html/parsoid

7% Solution 7%25 Solution

!!end !! test Link containing % as a double hex sequence interpreted to hex sequence !! wikitext [[7%2525 Solution]] !! html

[[7%2525 Solution]]

!!end ## Example for such a section: == < == !! test Link containing "#<" and "#>" % as a hex sequences- these are valid section anchors !! options title=[[Main Page]] !! config wgFragmentMode=[ "html5", "legacy" ] !! wikitext [[%23%3c]][[%23%3e]] !! html/php

#<#>

!! html/parsoid

#<#>

!! end ## Example for such a section: == < == !! test Link containing "#<" and "#>" % as a hex sequences- these are valid section anchors (legacy) !! config wgFragmentMode=[ "legacy" ] !! wikitext [[%23%3c]][[%23%3e]] !! html/php

#<#>

!! end !! test Link containing "<#" and ">#" as a hex sequences !! wikitext [[%3c%23]][[%3e%23]] !! html

[[%3c%23]][[%3e%23]]

!! end !! test Link containing an equals sign !! wikitext [[Special:BookSources/isbn=4-00-026157-6]] !! html/php

Special:BookSources/isbn=4-00-026157-6

!! html/parsoid

Special:BookSources/isbn=4-00-026157-6

!! end !! article Foo & bar !! text Just a test of an article title containing an ampersand !! endarticle !! test Link containing an ampersand !! wikitext [[Foo & bar]] [[Foo & bar]] [[Foo &amp; bar]] !! html/php

Foo & bar

Foo & bar

[[Foo &amp; bar]]

!! html/parsoid

Foo & bar

Foo & bar

[[Foo &amp; bar]]

!! end !! article Foo~bar !! text Just a test of an article title containing a tilde. !! endarticle # note that links containing signatures, like [[Foo~~~~]], are # massaged by the pre-save transform (PST) and so the tildes are never # seen by the parser. !! test Link containing a tilde !! wikitext [[Foo~bar]] !! html/php

Foo~bar

!! html/parsoid

Foo~bar

!! end !! article Lista d''e paise d''o munno !! text Dummy article to suppress redlinks in tests !! end !! test Link containing double-single-quotes '' (T6598) !! wikitext [[Lista d''e paise d''o munno]] !! html/php

Lista d''e paise d''o munno

!! html/parsoid

Lista d''e paise d''o munno

!! end !! article Cool "Gator" !! text Dummy article to suppress redlinks in tests !! end !! test Link containing double quotes and spaces !! wikitext [[Cool "Gator"]] !! html/php

Cool "Gator"

!! html/parsoid

Cool "Gator"

!! end !! article Link !! text Dummy article to suppress redlinks in tests !! end !! test Link containing double-single-quotes '' in text (T6598 check) !! wikitext Some [[Link|pretty ''italics'' and stuff]]! !! html/php

Some pretty italics and stuff!

!! html/parsoid

Some pretty italics and stuff!

!! end !! test Link containing double-single-quotes '' in text embedded in italics (T6598 check) !! wikitext ''Some [[Link|pretty ''italics'' and stuff]]!'' !! html/php

Some pretty italics and stuff!

!! html/parsoid

Some pretty italics and stuff!

!! end !! article ''Pentecoste'' !! text Dummy article to suppress redlinks in tests !! end ## FIXME: Title part of filename is interpreted in php !! test Link with double quotes in title part (literal) and alternate part (interpreted) !! config wgParserEnableLegacyMediaDOM=false !! wikitext [[File:Denys_Savchenko_''Pentecoste''.jpg]] [[''Pentecoste'']] [[''Pentecoste''|Pentecoste]] [[''Pentecoste''|''Pentecoste'']] !! html/php

File:Denys Savchenko Pentecoste.jpg

''Pentecoste''

Pentecoste

Pentecoste

!! html/parsoid

File:Denys Savchenko ''Pentecoste''.jpg

''Pentecoste''

Pentecoste

Pentecoste

!! end !! test Plain link to URL !! wikitext [[http://www.example.com]] !! html/php

[[1]]

!! html/parsoid

[]

!! end !! test Plain link to URL with link text !! wikitext [[http://www.example.com Link text]] !! html

[Link text]

!! end !! test Plain link to URL containing special characters, with link text (see T213950). !! wikitext [[http://www.example.com/?q=%7Babc%7D Link text]] !! html

[Link text]

!! end !! test Plain link to protocol-relative URL !! wikitext [[//www.example.com]] !! html/php

[[1]]

!! html/parsoid

[]

!! end !! test Plain link to protocol-relative URL with link text !! wikitext [[//www.example.com Link text]] !! html

[Link text]

!! end !! test Plain link to page with question mark in title !! wikitext [[A?b]] [[A?b|Baz]] !! html

A?b

Baz

!! end # I'm fairly sure the expected result here is wrong. # We want these to be URL links, not pseudo-pages with URLs for titles.... # However the current output is also pretty screwy. # # ---- # I'm changing it to match the current output--it arguably makes more # sense in the light of the test above. Old expected result was: #

Piped link to URL: an example URL #

# But I think this test is bordering on "garbage in, garbage out" anyway. # -- wtm !! test Piped link to URL !! wikitext Piped link to URL: [[http://www.example.com|an example URL]] !! html/php

Piped link to URL: [example URL]

!! html/parsoid

Piped link to URL: [example URL]

!! end !! article Example !! text Dummy article to suppress redlinks in tests !! end !! test Nested wikilink syntax in wikilink syntax that parses as wikilink in extlink !! options parsoid=wt2html !! wikitext [[http://example.com|[[Example]]]] !! html/php

[Example]

!! html/parsoid

[Example]

!! end !! test Plain link in template argument !! options parsoid=wt2html !! wikitext {{1x|[http://www.example.com |123]}} {{1x|[[http://www.example.com |123]]}} {{1x|[[http://www.example.com |123]}} {{1x|[http://www.example.com |123]]}} !! html/php

[http://www.example.com

[|123]

{{1x|[|123}}

[http://www.example.com

!! html/parsoid

[http://www.example.com

[|123]

{{1x|[|123}}

[http://www.example.com

!! end !! test T2002: [[page|http://url/]] should link to page, not http://url/ !! wikitext [[Main Page|http://url/]] !! html/php

http://url/

!! html/parsoid

http://url/

!! end # Parsoid does not mark self-links, by design. !! test T2337: Escaped self-links should be bold !! options title=[[Bug462]] !! wikitext [[Bug462]] [[Bug462]] !! html/php

Bug462 Bug462

!! html/parsoid

Bug462 Bug462

!! end !! test Self-link to section should not be bold !! options title=[[Main Page]] !! wikitext [[Main Page#section]] !! html/php

Main Page#section

!! html/parsoid

Main Page#section

!! end !! test Self-link hash fragment should be escaped !! options title=[[Main Page]] !! wikitext [[Main Page#section with spaces]] !! html/php

Main Page#section with spaces

!! html/parsoid

Main Page#section with spaces

!! end !! article 00 !! text This is 00. !! endarticle !!test Self-link to numeric title !!options title=[[0]] !! wikitext [[0]] !! html/php

0

!! html/parsoid

0

!!end !!test Link to numeric-equivalent title !!options title=[[0]] !! wikitext [[00]] !! html

00

!!end !! test inside a link !! wikitext [[Main Page]] [[Main Page|the main page [it's not very good]]] !! html/php

[[Main Page]] the main page [it's not very good]

!! html/parsoid

[[Main Page]] the main page [it's not very good]

!! end ## Parsoid doesn't get this right and even fails wt2html because, when doing the ## normalization for comparison, the html serialization / re-parse doesn't ## roundtrip. This is T49963 !! test
 inside a link
!! wikitext
[[Main
 Page
]] [[Main Page|the main page
[it's not very good]
]] !! html/php

[[Main

 Page

]] the main page

[it's not very good]
!! html/parsoid

[[Main

 Page

]] the main page

[it's not very good]

!! end !! test Non-breaking spaces in title !! wikitext [[  Main   Page  ]] !! html

  Main   Page  

!!end # Add new article for the test below so that it doesn't red-link !! article Foo bar baz !! text boo !! endarticle !! test Multiple spaces in titles should normalize to a single underscore !! options parsoid=wt2html,wt2wt !! wikitext [[Foo bar baz|x]] [[Foo bar baz|x]] [[Foo bar baz|x]] !! html/php

x x x

!! html/parsoid

x x x

!! end !! test Internal link with ca linktrail, surrounded by bold apostrophes (T29473 primary issue) !! options language=ca !! wikitext '''[[Main Page]]''' !! html

Main Page

!! end !! test Internal link with ca linktrail, surrounded by italic apostrophes (T29473 primary issue) !! options language=ca !! wikitext ''[[Main Page]]'' !! html

Main Page

!! end !! test Internal link with en linktrail: no apostrophes (T29473) !! options language=en !! wikitext [[Something]]'nice !! html/php

Something'nice

!! html/parsoid

Something'nice

!! end !! test Internal link with ca linktrail with apostrophes (T29473) !! options language=ca !! wikitext [[Something]]'nice !! html/php

Something'nice

!! html/parsoid

Something'nice

!! end !! test Internal link with kaa linktrail with apostrophes (T29473) !! options language=kaa !! wikitext [[Something]]'nice !! html/php

Something'nice

!! html/parsoid

Something'nice

!! end !! article User:Foo/Test/63636:Bar !! text Dummy article to suppress redlinks in tests !! end !! test Link with multiple ":" in a subpage-supporting namespace (T65636) !! wikitext [[User:Foo/Test/63636:Bar|Test]] !! html/php

Test

!! html/parsoid

Test

!! end ## Mainly a check for Parsoid !! test Handle title parsing for subpages !! options title=[[/123123]] subpage !! wikitext 123 !! html/php

123

!! html/parsoid

123

!! end !! article User:Test/123 !! text test 123 !! endarticle !! test Link to a subpage from a namespace other than main !! options title=[[User:Test]] subpage !! wikitext [[/123]] !! html/php

/123

!! html/parsoid

/123

!! end !! test Ensure that transclusion titles are not url-decoded !! options subpage title=[[Test]] parsoid=wt2html !! wikitext {{Bar%C3%A9}} {{/Bar%C3%A9}} !! html/php

{{Bar%C3%A9}} {{/Bar%C3%A9}}

!! html/parsoid

{{Bar%C3%A9}} {{/Bar%C3%A9}}

!! end !! test Purely hash wikilink !! options title=[[User:Test/123]] subpage !! wikitext [[#a|b]] !! html/php

b

!! html/parsoid

b

!! end !! test Serialization of purely hash wikilink !! options title=[[User:Test/123]] subpage parsoid=html2wt !! html/parsoid

[[

!! wikitext [[#a|[[]] !! html/php

[[

!! end !! test 1. Interaction of linktrail and template encapsulation !! wikitext {{1x|[[Foo]]}}l {{1x|[[Foo]]l}} {{1x|[[Foo]]l}}s {{1x|[[Foo]]ls}} [[{{1x|Foo}}]]l !! html/php

Fool

Fool

Fools

Fools

Fool

!! html/parsoid

Fool

Fool

Fools

Fools

Fool

!! end !! article Fool !! text Dummy article to suppress redlinks in tests !! end !! test 2. Interaction of linktrail and template encapsulation !! wikitext {{1x|Some [[Fool]]}}s !! html/php

Some Fools

!! html/parsoid

Some Fools

!! end !! test 3. Interaction of linktrail and template encapsulation !! wikitext {{1x|Some [[Fool]]s are '''bold and foolish'''}} !! html/php

Some Fools are bold and foolish

!! html/parsoid

Some Fools are bold and foolish

!! end !! article Söfnuður !! text Test. !! endarticle !! test Internal link with is link prefix !! options language=is !! wikitext Aðrir mótmælenda[[söfnuður|söfnuðir]] og {{1x|mótmælenda[[söfnuður|söfnuðir]]}} mótmæ{{1x|lenda[[söfnuður|söfnuðir]]}} !! html/php

Aðrir mótmælendasöfnuðir og mótmælendasöfnuðir mótmælendasöfnuðir

!! html/parsoid

Aðrir mótmælendasöfnuðir og mótmælendasöfnuðir mótmælendasöfnuðir

!! end !! article Mótmælendatrú !! text Test. !! endarticle !! test Internal link with is link trail and link prefix !! options language=is !! wikitext [[mótmælendatrú|xxx]]ar [[mótmælendatrú]]ar mótmælenda[[söfnuður]] mótmælenda[[söfnuður|söfnuðir]] mótmælenda[[söfnuður|söfnuðir]]xxx !! html

xxxar mótmælendatrúar mótmælendasöfnuður mótmælendasöfnuðir mótmælendasöfnuðirxxx

!! end !! test Parsoid link trail escaping !! options parsoid=html2wt,html2html !! html/parsoid

apples

!! wikitext [[apple]]s !! end !! test Parsoid link prefix escaping !! options language=is parsoid=html2wt,html2html !! html/parsoid

Aðrir mótmælendasöfnuður

!! wikitext Aðrir mótmælenda[[söfnuður]] !! end !! test Parsoid link bracket escaping !! options parsoid=html2wt,html2html !! html/parsoid

Test

[Test]

[[Test]]

[[[Test]]]

[[[[Test]]]]

[[[[[Test]]]]]

!! wikitext [[Test]] [[[Test]]] [[[[Test]]]] [[[[[Test]]]]] [[[[[[Test]]]]]] [[[[[[[Test]]]]]]] !! end !! test Parsoid-centric test: Whitespace in ext- and wiki-links should be preserved !! wikitext [[Foo| bar]] [[Foo| ''bar'']] [http://wp.org foo] [http://wp.org ''foo''] !! html

bar

bar

foo

foo

!! end !! test Parsoid: Scoped parsing should handle mixed transclusions and plain text !! wikitext [[Foo|{{1x|a}} b {{1x|c}}]] !! html/parsoid

a b c

!! end !! test Link with angle bracket after anchor !! config wgFragmentMode=[ "html5", "legacy" ] !! wikitext [[Foo#]] !! html/php

Foo#<bar>

!! html/parsoid

Foo#<bar>

!! end !! test Link with angle bracket after anchor (legacy) !! config wgFragmentMode=[ "legacy" ] !! wikitext [[Foo#]] !! html/php

Foo#<bar>

!! end !! article Ho !! text Dummy article to suppress redlinks in tests !! end !! test Wikilink in wikilink !! wikitext [[Hi|[[Ho]]]] !! html/php

[[Hi|Ho]]

!! html/parsoid

[[Hi|Ho]]

!! end !! test Parsoid-specific test: Wikilinks with   should RT properly !! options language=ln !! wikitext [[WW II]] !! html/php

WW II

!! html/parsoid

WW II

!! end !! test Parsoid T55221: Wikilinks should be properly entity-escaped !! options parsoid={ "modes": ["html2wt"], "suppressErrors": true } !! html/parsoid

He&nbsp;llo He&nbsp;llo

He&nbsp;llo He&nbsp;llo

!! wikitext He&nbsp;llo [[Foo|He&nbsp;llo]] He&nbsp;llo He&nbsp;llo !! html/php

He&nbsp;llo He&nbsp;llo

He&nbsp;llo He&nbsp;llo

!! end !! article 16:30 !! text Dummy article to suppress redlinks in tests !! end !! test Wikilinks with : should roundtrip correctly, with and without redlinks !! wikitext [[16:30]] [[18:30]] !! html/parsoid

16:30 18:30

!! end # html2wt will fail because of title normalization without data-parsoid !! test Parsoid: handle constructor well !! options parsoid=wt2html,wt2wt !! wikitext [[constructor]] [[constructor:foo]] !! html/php

constructor

constructor:foo

!! html/parsoid

constructor

constructor:foo

!! end !! test Template parameter named "constructor" !! wikitext {{1x| constructor = |hi}} !! html/parsoid

hi

!! end ## ## XHTML tidiness ### !! test
to
!! wikitext 1
2
3 !! html

1
2
3

!! end !! test Broken br tag sanitization !! options parsoid=wt2html,html2html !! wikitext
!! html/php


!! html/parsoid


!! end # TODO: Fix html2html mode (T53055)! !! test Parsoid: Broken br tag recognition !! options parsoid=wt2html !! wikitext

!! html



!! end !! test Incorrecly removing closing slashes from correctly formed XHTML !! wikitext
!! html


!! end !! test Failing to transform badly formed HTML into correct XHTML !! wikitext


!! html




!!end ## Parsoid's behavior w/ self-closing HTML tags is now a bug; ## see T134423. Legacy Parser now implements proper HTML5 semantics. !! test Handling html with a div self-closing tag !! wikitext
!! html
!! end !! test Elements with solidus in various attribute positions !! options parsoid=wt2html,html2html !! wikitext
ha
ha
ha
!! html/php
ha
ha
ha
!! html/parsoid
ha
ha
ha
!! end !! test Handling html with a br self-closing tag !! wikitext





!! html/php







!! html/parsoid







!! end !! test Quoted attributes without spaces !! options parsoid=wt2html !! wikitext
red
!! html/php
red
!! html/parsoid
red
!! end !! test Horizontal ruler (should it add that extra space?) !! wikitext

foo
bar !! html/php

foo


bar

!! html/parsoid

foo


bar

!! end !! test Horizontal ruler -- 4+ dashes render hr !! wikitext ---- !! html
!! end !! test Horizontal ruler -- eats additional dashes on the same line !! wikitext --------- !! html
!! end !! test Horizontal ruler -- does not collapse dashes on consecutive lines !! wikitext ---- ---- !! html

!! end !! test Horizontal ruler -- <4 dashes render as plain text !! wikitext --- !! html

---

!! end !! test Horizontal ruler -- Supports content following dashes on same line !! wikitext ---- Foo !! html/php

Foo

!! html/parsoid

Foo

!! end ### ### Block-level elements ### !! test Common list !! wikitext *Common list *item 2 *item 3 !! html
  • Common list
  • item 2
  • item 3
!! end !! test Numbered list !! wikitext #Numbered list #item 2 #item 3 !! html
  1. Numbered list
  2. item 2
  3. item 3
!! end # the switch from level 3 to ordered should not introduce a newline between !! test Mixed list !! wikitext *Mixed list *#with numbers **and bullets *#and numbers *bullets again **bullet level 2 ***bullet level 3 ***#Number on level 4 **bullet level 2 **#Number on level 3 **#Number on level 3 *#number level 2 *Level 1 ***Level 3 #**Level 3, but ordered !! html
  • Mixed list
    1. with numbers
    • and bullets
    1. and numbers
  • bullets again
    • bullet level 2
      • bullet level 3
        1. Number on level 4
    • bullet level 2
      1. Number on level 3
      2. Number on level 3
    1. number level 2
  • Level 1
      • Level 3
      • Level 3, but ordered
!! end !! test 1. Nested mixed wikitext and html list !! wikitext *hi *
  • ho
*hi **ho !! html/php
  • hi
    • ho
  • hi
    • ho
!! html/parsoid
  • hi
    • ho
  • hi
    • ho
!! end !! test 2. Nested mixed wikitext and html list (incompatible) !! wikitext ;hi :{{1x|
  • ho
  • }} !! html/php
    hi
  • ho
  • !! html/parsoid
    hi
  • ho
  • !! end !! test Nested lists 1 !! wikitext *foo **bar !! html
    • foo
      • bar
    !! end !! test Nested lists 2 !! wikitext **foo *bar !! html
      • foo
    • bar
    !! end !! test Nested lists 3 (first element empty) !! wikitext * **bar !! html
      • bar
    !! end !! test Nested lists 4 (first element empty) !! wikitext ** *bar !! html
    • bar
    !! end !! test Nested lists 5 (both elements empty) !! wikitext ** * !! html
    !! end !! test Nested lists 6 (both elements empty) !! wikitext * ** !! html
    !! end !! test Nested lists 7 (skip initial nesting levels) !! wikitext ***foo !! html
        • foo
    !! end !! test Nested lists 8 (multiple nesting transitions) !! wikitext *foo ***bar **baz *boo !! html
    • foo
        • bar
      • baz
    • boo
    !! end # XXX this test should be moved to citeParserTests, since it depends # on the Cite extension, which is "built in" to Parsoid. !! test Nested lists 9 (extension interaction) !! wikitext * !! html/php-DISABLED
    !! html/parsoid
      !! end !! test Nested lists 10 (list and span siblings: wt2wt regression) !! wikitext *a x **b y !! html/parsoid
      • a x
        • b y
      !! end !! test Nested lists 11 (T262409: trailing whitespace & selser) !! options parsoid={ "modes": ["wt2html","selser"], "changes": [ [ "ul > li > ul > li > ul > li", "after", "
    • b-new
    • " ] ] } !! wikitext **a ***b !! html/parsoid
        • a
          • b
      !! wikitext/edited **a ***b *** b-new !! end !! test 1. Lists and block-element interaction !! options parsoid=wt2html,selser !! wikitext *
      a *b
      ಕ !! html/php
      • a
      • b

      !! html/parsoid
      • a
      • b

      !! end !! test 2. Lists and block-element interaction !! options parsoid=wt2html,selser !! wikitext *{{1x|
      a *b }}
      ಕ !! html/php
      • a
      • b

      !! html/parsoid
      • a
      • b

      !! end !! test 1. Lists with start-of-line-transparent tokens before bullets: Comments !! wikitext *foo *bar *baz !! html
      • foo
      • bar
      • baz
      !! html/parsoid
      • foo
      • bar
      • baz
      !! end # Parsoid handles this case differently from the legacy parser, as a side # effect of handling SOL state in the tokenizer. !! test 2. Lists with start-of-line-transparent tokens before bullets: Template close !! wikitext *foo {{1x|bar }}*baz !! html/php
      • foo bar
      • baz
      !! html/parsoid
      • foo bar
      • baz
      !! end !! test List items are not parsed correctly following a
       block (T2785)
      !! wikitext
      *
      foo
      *
      bar
      *zar !! html/php
      • foo
      • bar
      • zar
      !! html/parsoid
      • foo
      • bar
      • zar
      !! end !! test List items from template !! wikitext {{inner list}} *item 2 *item 0 {{inner list}} *item 2 *item 0 *notSOL{{inner list}} *item 2 !! html/php
      • item 1
      • item 2
      • item 0
      • item 1
      • item 2
      • item 0
      • notSOL
      • item 1
      • item 2
      !! html/parsoid
      • item 1
      • item 2
      • item 0
      • item 1
      • item 2
      • item 0
      • notSOL
      • item 1
      • item 2
      !! end !! test List interrupted by empty line or heading !! wikitext *foo **bar ==A heading== *Another list item !! html
      • foo
        • bar

      A heading[edit]

      • Another list item
      !!end !! test Multiple list tags generated by templates !! wikitext {{1x|
    • }}a {{1x|
    • }}b {{1x|
    • }}c !! html/php
    • a
    • b
    • c
    • !! html/parsoid
    • a
    • b
    • c
    • !! end !! test Multiple newlines in between HTML list items don't induce paragraph wrapping !! wikitext
      • hi
      • ho
      hi
      ho
      123
      !! html/php
      • hi
      • ho
      hi
      ho
      123
      !! end !!test Single-comment whitespace lines dont break lists, and neither do multi-comment whitespace lines !! wikitext *a *b *c *d !! html
      • a
      • b
      • c
      • d
      !!end !!test Replacing whitespace with tabs still doesn't break the list (gerrit 78327) !! wikitext *a *b *c *d !! html
      • a
      • b
      • c
      • d
      !!end ## FIXME: This test could possibly be renamed / simplified since this is ## no longer a hack and works as expected without any special handling. !!test Test the li-hack (a hack from Tidy days, but doesn't work as advertised with Remex) !!options parsoid=wt2html,wt2wt !! wikitext *foo *
    • li-hack **bar1 *{{1x|
    • templated li-hack}} **bar2 *
    • unsupported li-hack with preceding comments
      • not a li-hack
      !! html/php
      • foo
      • li-hack
        • bar1
      • templated li-hack
        • bar2
      • unsupported li-hack with preceding comments
      • not a li-hack
      !! html/parsoid
      • foo
      • li-hack
        • bar1
      • templated li-hack
        • bar2
      • unsupported li-hack with preceding comments
      • not a li-hack
      !! end !! test Parsoid: Make sure nested lists are serialized on their own line even if HTML contains no newlines !! wikitext #foo ##bar *foo **bar :foo ::bar !! html/php
      1. foo
        1. bar
      • foo
        • bar
      foo
      bar
      !! html/parsoid
      1. foo
        1. bar
      • foo
        • bar
      foo
      bar
      !! end !! test Parsoid: Test of whitespace serialization with Templated bullets !! options parsoid=wt2html !! wikitext * {{bullet}} !! html/parsoid
      • Bar
      !! end # ------------------------------------------------------------------------ # The next set of tests are about Parsoid's ability to handle badly nested # tags (parse, minimize scope of fixup, and roundtrip back) # ------------------------------------------------------------------------ !! test Unbalanced closing block tags break a list !! wikitext
      *a
      *b
      !! html/php
      • a
    • b
    • !! html/parsoid
      • a
      • b
      !! end ## We call this "wikitext block" because we're diverging a bit from the HTML5 ## parsing spec. Remex output is because it doesn't need to generate the ## implied end tag for the list item when encountering the closing

      but ## Parsoid's broader definition opts to. This can happen for a number of other ## tags but those aren't allowed literal tags in wikitext. There's also the ## opposite problem, where the wikitext blocks aren't a superset of the tags ## that generate implied ends in HTML5, but the missing ones again aren't ## allowed literal tags in wikitext. !! test Unbalanced closing wikitext block tags break a list !! wikitext

      *a

      *b

      !! html/php

      • a

      • b

      !! html/parsoid

      • a

      • b

      !! end !! test Unbalanced closing non-block tags don't break a list !! options parsoid=wt2html,html2html !! wikitext *a *b !! html/php

      • a
      • b
      !! html/parsoid

      • a
      • b
      !! end # Parsoid does some post-dom-building cleanup # which is why its output differs from Remex. !! test Unclosed formatting tags that straddle lists are closed and reopened !! options parsoid=wt2html,wt2wt,html2html !! wikitext # a #b !! html/php
      1. a
      2. b
      !! html/parsoid
      1. a
      2. b
      !! end # Output is ugly because of all the misnested tag fixups. !! test 1. List embedded in a formatting tag !! wikitext *foo !! html/php

      • foo

      !! html/parsoid

      • foo

      !! end # Output is ugly because of all the misnested tag fixups. !! test 2. List embedded in a formatting tag in a misnested way !! wikitext *a *b !! html/php

      • a
      • b
      !! html/parsoid

      • a
      • b
      !! end # Output is ugly because of all the misnested tag fixups. !! test 3. List embedded in a formatting tag in a misnested way !! wikitext ** 123 !! html/php

        • 123
      !! html/parsoid

        • 123
      !! end !! test Parsoid: unknown parser function (T314524) !! wikitext {{#tag:b|This is a known parser function}} Now show the unknown parser functions for comparison. {{#foo}} {{#foo:bar|bat}} !! html/php

      This is a known parser function

      Now show the unknown parser functions for comparison.

      {{#foo}}

      {{#foo:bar|bat}}

      !! html/parsoid+standalone

      This is a known parser function

      Now show the unknown parser functions for comparison.

      Parser function implementation for pf_foo missing in Parsoid.

      Parser function implementation for pf_foo missing in Parsoid.

      !! html/parsoid+integrated

      This is a known parser function

      Now show the unknown parser functions for comparison.

      {{#foo}}

      {{#foo:bar|bat}}

      !! end # From plwiki:PLOS_ONE !! test Parsoid: Page property magic word with magic word contents !! options showtitle !! config wgAllowDisplayTitle=true wgRestrictDisplayTitle=false !! wikitext {{DISPLAYTITLE:''{{PAGENAME}}''}} !! metadata Parser test !! html/php !! html/parsoid !! end # NOTE: mw:ExpandedAttrs is not the best typeof here. mw:Transclusion is better. # But, this is a limitation of our representation and is documented in # TemplateHandler.php in processSpecialMagicWord !! test Parsoid: Template-generated DISPLAYTITLE !! wikitext {{{{1x|DISPLAYTITLE}}:Foo}} !! options showtitle !! config wgAllowDisplayTitle=true wgRestrictDisplayTitle=false !! metadata Foo !! html/php !! html/parsoid !! end !! test Namespace 1 {{ns:1}} !! wikitext {{ns:1}} !! html/php

      Talk

      !! html/parsoid+integrated

      Talk

      !! end !! test Namespace 1 {{ns:01}} !! wikitext {{ns:01}} !! html/php

      Talk

      !! html/parsoid+integrated

      Talk

      !! end !! test Namespace 0 {{ns:0}} (T6783) !! wikitext {{ns:0}} !! html/php !! html/parsoid+integrated !! end !! test Namespace 0 {{ns:00}} (T6783) !! wikitext {{ns:00}} !! html !! html/parsoid+integrated !! end !! test Namespace -1 {{ns:-1}} !! wikitext {{ns:-1}} !! html/php

      Special

      !! html/parsoid+integrated

      Special

      !! end !! test Namespace User {{ns:User}} !! wikitext {{ns:User}} !! html

      User

      !! end !! test Namespace User talk {{ns:User_talk}} !! wikitext {{ns:User_talk}} !! html

      User talk

      !! end !! test Namespace User talk {{ns:uSeR tAlK}} !! wikitext {{ns:uSeR tAlK}} !! html

      User talk

      !! end !! test Namespace File {{ns:File}} !! wikitext {{ns:File}} !! html

      File

      !! end !! test Namespace File {{ns:Image}} !! wikitext {{ns:Image}} !! html

      File

      !! end !! test Namespace (lang=de) Benutzer {{ns:User}} !! options language=de !! wikitext {{ns:User}} !! html

      Benutzer

      !! end !! test Namespace (lang=de) Benutzer Diskussion {{ns:3}} !! options language=de !! wikitext {{ns:3}} !! html

      Benutzer Diskussion

      !! end !! test Urlencode !! wikitext {{urlencode:hi world?!}} {{urlencode:hi world?!|WIKI}} {{urlencode:hi world?!|PATH}} {{urlencode:hi world?!|QUERY}} !! html/php

      hi+world%3F%21 hi_world%3F! hi%20world%3F%21 hi+world%3F%21

      !! end !! test Magic Word: prioritize type info over data-parsoid !! options parsoid=html2wt !! html/parsoid !! wikitext __FORCETOC__ !! end !! test Magic Word: serialize on separate line (parsoid) !! options parsoid=wt2wt,html2wt !! wikitext foo __NOTOC__ bar !! html/parsoid foobar !! end !! test Magic Word: case-insensitive (all-lowercase) !! wikitext foo __notoc__ bar !! html/php

      foo

      bar

      !! html/parsoid

      foo bar

      !! end # wt2wt,html2wt disabled because we always (unless selser) serialize # in a uniform case (all upper or all lower) !! test Magic Word: case-insensitive (mixed case) !! options parsoid=wt2html,html2html !! wikitext foo __NOtOC__ bar !! html/php

      foo

      bar

      !! html/parsoid

      foo bar

      !! end !! test Magic Word: rt non-english wikis !! options parsoid=wt2wt language=de !! wikitext __NOEDITSECTION__ !! html/parsoid !! end !!test __proto__ is treated as normal wikitext (T105997) !!wikitext __proto__ !!html

      __proto__

      !!end ### ### Templates #### !! test Nonexistent template !! wikitext {{thistemplatedoesnotexist}} !! html/php

      Template:Thistemplatedoesnotexist

      !! html/parsoid

      Template:Thistemplatedoesnotexist

      !! end !! test Template with invalid target containing tags !! wikitext {{ab|{{1x|foo}}|{{1x|a}}={{1x|b}}|a = b}} !! html

      {{ab|foo|a=b|a = b}}

      !! end !! test Template with invalid target containing unclosed tag !! options parsoid=wt2html !! wikitext {{a|{{1x|foo}}|{{1x|a}}={{1x|b}}|a = b}} !! html/php

      {{a|foo|a=b|a = b}}

      !! html/parsoid

      {{a|foo|a=b|a = b}}

      !! end !! test Template with invalid target containing wikilink !! wikitext {{[[Main Page]]}} !! html/php

      {{Main Page}}

      !! html/parsoid

      {{Main Page}}

      !! end # The html2html output of this test is currently failing # because the html2wt output is broken; see # https://phabricator.wikimedia.org/T220018#5123777 for a discussion. # Not (yet) including html2wt as a test mode because there are # a couple of different correct ways this could be 'ed. !! test Template with just whitespace in it, T70421 !! wikitext {{1x|{{ }}}} !! options parsoid=wt2html,html2html !! html/php

      {{ }}

      !! html/parsoid

      {{ }}

      !! end # This is currently the wikitext output of html2wt on the above test # case; note that it is broken! Adding a around the closing # brace changes how the open braces associate, breaking the outer # {{1x}} template invocation. *However* this "broken" wikitext # exposed a useful tokenizer bug (T221384) in how the broken_template # rule was being backtracked into, so it's a useful test case even # if/when the above test case gets its html2wt output fixed. !! test Template with just whitespace (bad template brace matching) !! options parsoid=wt2html !! wikitext {{1x|{{ }}}} !! html/php

      {{1x|{{ }}}}

      !! html/parsoid

      {{1x|{{ }}}}

      !! end !! article Template:test !! text This is a test template !! endarticle !! test Simple template !! wikitext {{test}} !! html

      This is a test template

      !! end !! test Template with explicit namespace !! wikitext {{Template:test}} !! html

      This is a test template

      !! end !! article Template:paramtest !! text This is a test template with parameter {{{param}}} !! endarticle !! test Template parameter !! wikitext {{paramtest|param=foo}} !! html

      This is a test template with parameter foo

      !! end !! article Template:paramtestnum !! text [[{{{1}}}|{{{2}}}]] !! endarticle !! test Template unnamed parameter !! wikitext {{paramtestnum|Main Page|the main page}} !! html

      the main page

      !! end !! article Template:templatesimple !! text (test) !! endarticle !! article Template:templateredirect !! text #redirect [[Template:templatesimple]] !! endarticle !! article Template:templateasargtestnum !! text {{{{{1}}}}} !! endarticle !! article Template:templateasargtest !! text {{template{{{templ}}}}} !! endarticle !! article Template:templateasargtest2 !! text {{{{{templ}}}}} !! endarticle !! test Template with template name as unnamed argument !! wikitext {{templateasargtestnum|templatesimple}} !! html

      (test)

      !! end !! test Template with template name as argument !! wikitext {{templateasargtest|templ=simple}} !! html

      (test)

      !! end !! test Template with template name as argument (2) !! wikitext {{templateasargtest2|templ=templatesimple}} !! html

      (test)

      !! end !! article Template:templateasargtestdefault !! text {{{{{templ|templatesimple}}}}} !! endarticle !! article Template:templa !! text '''templ''' !! endarticle !! test Template with default value !! wikitext {{templateasargtestdefault}} !! html

      (test)

      !! end !! test Template with default value (value set) !! wikitext {{templateasargtestdefault|templ=templa}} !! html

      templ

      !! end !! test Template redirect !! wikitext {{templateredirect}} !! html/php

      (test)

      !! html/parsoid+standalone !! html/parsoid+integrated

      (test)

      !! end !! test Template with argument in separate line !! wikitext {{ templateasargtest | templ = simple }} !! html

      (test)

      !! end !! test Template with complex template as argument !! wikitext {{paramtest| param ={{ templateasargtest | templ = simple }}}} !! html

      This is a test template with parameter (test)

      !! end !! test Templates with templated name !! wikitext {{{{1x|1x}}|foo}} {{{{1x|inner list}} }} !! html

      foo

      • item 1
      !! html/parsoid

      foo

      • item 1
      !! end ## Regression test; the output here isn't really that interesting. ## wt2html only, since the bare {{ will get escaped when serializing ## needs investigation! ## In integrated mode, since the whole "{{...}}" is sent to core for ## processing, we wrap the output (unexpanded text) in a Transclusion. !! test Templates with templated name and top level template args !! options parsoid=wt2html !! wikitext {{1{{2{{{3}}}|4=5}}}} !! html/php

      {{1{{2{{{3}}}|4=5}}}}

      !! html/parsoid+standalone

      {{1{{2{{{3}}}|4=5}}}}

      !! html/parsoid+integrated

      {{1{{2{{{3}}}|4=5}}}}

      !! end ## wt2html only, since the bare {{ will get escaped when serializing !! test Templates with invalid templated targets !! options parsoid=wt2html !! wikitext {{1x {{1x|foo}} }} !! html/php

      {{1x foo }}

      !! html/parsoid

      {{1x foo }}

      !! end !! article Template:complextemplate !! text {{{1}}} {{paramtest| param ={{{param}}}}} !! endarticle !! test Template with complex arguments !! wikitext {{complextemplate| param ={{ templateasargtest | templ = simple }}|[[Template:complextemplate|link]]}} !! html

      link This is a test template with parameter (test)

      !! end !! test T2553: link with two variables in a piped link !! wikitext {| |[[{{{1}}}|{{{2}}}]] |} !! html/php
      [[{{{1}}}|{{{2}}}]]
      !! html/parsoid
      [[{{{1}}}|{{{2}}}]]
      !! end !! article One !! text Dummy article to suppress redlinks in tests !! end # See: T2553 !! test Abort table cell attribute parsing on wikilink !! wikitext {| |testing [[one|two]] |three||four |testing one two |three||four |testing="[[one|two]]" |three||four |} !! html/php
      testing two |three four three four testing="two" |three four
      !! html/parsoid
      testing two |threefour threefour testing="two" |threefour
      !! end !! article Three !! text Dummy article to suppress redlinks in tests !! end ## We don't care about Parsoid's output here as much as whether ## attribute parsing breaks because of a wikilink. ## Parsoid's standalone mode doesn't have a compliant ParserFunction extension !! test Don't abort table cell attribute parsing if wikilink is found in template arg !! wikitext {| |Test {{#tag:ref|One two "[[three]]" four}} |} !! html/parsoid+standalone
      Test One two "three" four
      !! html/parsoid+integrated
      Test [1]
      1. One two "three" four
      !! end !! test Magic variable as template parameter !! wikitext {{paramtest|param={{SITENAME}}}} !! html

      This is a test template with parameter MediaWiki

      !! end !! article Template:linktest !! text [[{{{param}}}|link]] !! endarticle !! test Template parameter as link source !! wikitext {{linktest|param=Main Page}} !! html

      link

      !! end !!article Template:paramtest2 !! text including another template, {{paramtest|param={{{arg}}}}} !! endarticle !! test Template passing argument to another template !! wikitext {{paramtest2|arg='hmm'}} !! html

      including another template, This is a test template with parameter 'hmm'

      !! end !! article Template:Linktest2 !! text Main Page !! endarticle !! test Template as link source !! wikitext [[{{linktest2}}]] [[{{linktest2}}|Main Page]] [[{{linktest2}}]]Page !! html

      Main Page

      Main Page

      Main PagePage

      !! end !! article Template:loop1 !! text {{loop2}} !! endarticle !! article Template:loop2 !! text {{loop1}} !! endarticle !! test Template infinite loop !! wikitext {{loop1}} !! html/php

      Template loop detected: Template:Loop1

      !! html/parsoid

      Template loop detected: Template:Loop1

      !! end !! test Template from main namespace !! wikitext {{:Main Page}} !! html

      blah blah

      !! end !! test Template from non-includable namespace !! options wgNonincludableNamespaces=10 !! wikitext {{1x|uh oh!}} !! html

      Template:1x

      !! html/parsoid+integrated

      Template:1x

      !! end !! article Template:table !! text {| | 1 || 2 |- | 3 || 4 |} !! endarticle !! test T2529: Template with table, not included at beginning of line !! wikitext foo {{table}} !! html/php

      foo

      1 2
      3 4
      !! html/parsoid

      foo

      12
      34
      !! end !! test T2523: Template shouldn't eat newline (or add an extra one before table) !! wikitext foo {{table}} !! html

      foo

      1 2
      3 4
      !! end !! test T2041: Template parameters shown as broken links !! wikitext {{{parameter}}} !! html

      {{{parameter}}}

      !! end !! test Template with targets containing wikilinks !! options parsoid=wt2html !! wikitext {{[[foo]]}} {{[[{{1x|foo}}]]}} {{{{1x|[[foo}}]]}} !! html/php

      {{foo}}

      {{foo}}

      {{[[foo}}]]

      !! html/parsoid

      {{foo}}

      {{foo}}

      {{[[foo}}]]

      !! end !! article Template:'' !! text bar !! endarticle !! test Templates: Double quotes as template target !! wikitext foo {{''}} baz !! html/php

      foo bar baz

      !! html/parsoid

      foo bar baz

      !! end ## This test is about making sure Parsoid's data-mw is well formed in the ## face of multiple templates with intersecting and overlapping ranges. The ## wikitext itself is wretched. !! test Templates with intersecting and overlapping ranges !! wikitext {|{{1x|1=class="foo"

      ha

      }} {|{{1x|1=class="bar"

      ho

      }} {{1x|{{!}}hi}} |} !! html/php

      ha

      ho

      hi
      !! html/parsoid

      ha

      ho

      hi
      !! end !! article Template:MSGNW test !! text ''None'' of '''this''' should be * interpreted but rather passed unmodified {{test}} File:Foobar.jpg !! endarticle # hmm, fix this or just deprecate msgnw and document its behavior? !! test msgnw keyword !! wikitext {{msgnw:MSGNW test}} !! html/php

      ''None'' of '''this''' should be * interpreted but rather passed unmodified {{test}} <gallery> File:Foobar.jpg </gallery> <!-- comment -->

      !! end !! test int keyword !! wikitext {{int:youhavenewmessages|lots of money|not!}} !! html/php

      You have lots of money (not!).

      !! html/parsoid+integrated

      You have lots of money (not!).

      !! end !! test int keyword - non-existing message !! wikitext {{int:var}} !! html/php

      ⧼var⧽

      !! html/parsoid+integrated

      ⧼var⧽

      !! end !! article Template:Includes !! text Foozarbar !! endarticle !! test and being included !! wikitext {{Includes}} !! html

      Foobar

      !! end !! article Template:Includes2 !! text Foobar !! endarticle ## In integrated mode, Parsoid won't see the <*include*>.. tags from the expanded template !! test being included !! wikitext {{Includes2}} !! html/php

      Foo

      !! html/parsoid+standalone

      Foo

      !! html/parsoid+integrated

      Foo

      !! end !! article Template:Includes3 !! text Foobarzar !! endarticle ## In integrated mode, Parsoid won't see the <*include*>.. tags from the expanded template !! test and being included !! wikitext {{Includes3}} !! html/php

      Foo

      !! html/parsoid+standalone

      Foo

      !! html/parsoid+integrated

      Foo

      !! end # FIXME: Parsoid's markup for this is quite ugly. !! test and on a page !! wikitext Foozarbar !! html/php

      Foozar

      !! html/parsoid

      Foozar

      !! end !! test Un-closed !! wikitext !! html/php !! html/parsoid !! end !! test Empty !! wikitext Hello! !! html/php

      Hello!

      !! html/parsoid

      Hello!

      !! end !! test Nested s !! wikitext x y z !! html/php

      x y z

      !! html/parsoid

      x y z

      !! end !! test on a page !! wikitext Foobar !! html

      Foobar

      !! end !! test Un-closed !! wikitext !! html !! end !! test T236868: Un-closed caused bad SourceRange length !! wikitext {| |- | A |- |} !! html/parsoid
      !! end !!test Self-closed noinclude, includeonly, onlyinclude tags !! wikitext !! html


      !!end !!test Unbalanced includeonly and noinclude tags !! wikitext {| |a
      |b
      |c
      |d
      |} !! html
      a b c</includeonly> d</includeonly></includeonly>
      !!end # We're more interested in the generation of

      when reading than in round-tripping these - the RT without the newline # wouldn't be acceptable if "real" text were in the include tags, for instance. !! test includeonly / noinclude / onlyinclude and headers !! options parsoid = wt2html !! wikitext == test 1 == == test 2 == == test 3 == !! html/parsoid

      test 1

      test 2

      test 3

      !! html/php

      test 1

      test 2

      test 3

      !! end !! article Template:Includeonly section !! text ==Includeonly section== ==Section T-1== !!endarticle !! test T8563: Edit link generation for section shown by !! wikitext {{includeonly section}} !! html

      Includeonly section[edit]

      Section T-1[edit]

      !! end # Uses same input as the contents of [[Template:Includeonly section]] !! test T8563: Section extraction for section shown by !! options section=T-2 !! wikitext ==Includeonly section== ==Section T-2== !! html ==Section T-2== !! end !! test T8563: Edit link generation for section suppressed by !! wikitext ==Includeonly section== ==Section 1== !! html

      Section 1[edit]

      !! end !! test T8563: Section extraction for section suppressed by !! options section=1 !! wikitext ==Includeonly section== ==Section 1== !! html ==Section 1== !! end !! test Un-closed !! wikitext !! html/php !! html/parsoid !! end ## We used to, but no longer wt2wt this test since the default serializer ## will normalize the include directives to serialize on their own line. ## Selser will take care of preserving formatting in scenarios where they ## intermingled with other wikitext. ## This test also triggered T223411 during Parsoid-PHP porting. !! test Includes and comments at SOL !! options parsoid=wt2html,html2html !! wikitext ==hu== some *stuff *here some* stuff * here can have stuff===here=== __INDEX__== hi == !! html/php

      hu

      some

      • stuff
      • here


      some* stuff

      • here

      here

      hi

      !! html/parsoid

      hu

      some

      • stuff
      • here

      some* stuff

      • here

      here

      hi

      !! end # TODO: test with DOM fragment reuse! !! test Parsoid: DOM fragment reuse !! options parsoid=wt2wt,wt2html !! wikitext a{{1x|b
      c}}d a{{1x|b
      c}}d {{1x|a
      b}} !! html/php

      ab

      cd

      ab

      cd

      a

      b

      !! html/parsoid

      ab

      cd

      ab

      cd

      a

      b

      !! end !! test Parsoid: Merge double tds (T52603) !! wikitext {| |{{1x|{{!}} foo}} |} !! html/php
      foo
      !! html/parsoid
      foo
      !! end !! test Parsoid: Merge double tds in nested transclusion content (T52603) !! wikitext {{1x|
      }} {| |{{1x|{{!}} foo}} |} {{1x|
      }} !! html/php
      foo
      !! html/parsoid
      foo
      !! end ### ### and in attributes ### !!test 0. includeonly around the entire attribute !! wikitext id="v1"id="v2">bar !! html

      bar

      !!end !!test 1. includeonly in html attr key !! wikitext idabout="foo">bar !! html

      bar

      !!end !!test 2. includeonly in html attr value !! wikitext bar "v1""v2">bar !! html

      bar bar

      !!end !!test 3. includeonly in part of an attr value !! wikitext bar !! html

      bar

      !!end !!test 4. includeonly in table attributes !! wikitext {| |- |- |a |- |- |b |} !! html
      a
      !!end ### ### Token Stream Patcher tests ### ### These tests won't always pass wt2wt and other modes because ### on serialization, the table will be output on a new line. ### For now, we are prohibiting them, and using this to test selser. ### !!test 1. Table tag in SOL posn. should get reparsed correctly with valid TSR !!options parsoid=wt2html,wt2wt !!wikitext {{1x|}}{| width = '100%' |foo |} !!html/parsoid
      foo
      !!end ## We used to, but no longer wt2wt this test since the default serializer ## will normalize the include directives to serialize on their own line. ## Selser will take care of preserving formatting in scenarios where they ## intermingled with other wikitext. !!test 2. Table tag in SOL posn. should get reparsed correctly with valid TSR !!options parsoid=wt2html !!wikitext a{| {{{b}}} |c |} !!html/parsoid
      c
      !!end !! test Table wikitext syntax outside wiki-tables !! wikitext a |+ not a caption ! not a table heading |- not a table row | not a table cell | class="foo bar" | baz b |} |- c !! html

      a |+ not a caption ! not a table heading |- not a table row | not a table cell | class="foo bar" | baz b |} |- c

      !! end !! test Content after like wikitext should get fully processed !! wikitext x |- [[Foo]] and {{1x|bar}} y !! html/php

      x |- Foo and bar y

      !! html/parsoid

      x |- Foo and bar y

      !! end !! test P-wrapping should not break after s separated by newlines are converted back to pipes !! wikitext a |b |c d !! html/php

      a |b

      |c d

      !! html/parsoid

      a |b

      |c d

      !! end !! test Orphaned table row wikitext with templated table for an attribute should not duplicate table !! wikitext |-{{1x| {{{!}} {{!}}foo {{!}}} }} !! html/php

      |-

      foo
      !! html/parsoid

      |-

      foo
      !! end ### ### Testing parsing of templates where a template arg ### has the same name as the template itself. ### !! article Template:quote !! text {{{quote|{{{1}}}}}} !! endarticle !! test Templates: Template Name/Arg clash: 1. Use of positional param !! wikitext {{quote|foo}} !! html/php

      foo

      !! html/parsoid

      foo

      !! end !! test Templates: Template Name/Arg clash: 2. Use of named param !! wikitext {{quote|quote=foo}} !! html/php

      foo

      !! html/parsoid

      foo

      !! end ### ### Parsoid-centric tests to stress Parsoid's ability to RT them unchanged ### !!test Templates: 1. Simple use !! wikitext {{1x|Foo}} !! html

      Foo

      !!end !!test Templates: 2. Inside a block tag !! wikitext
      {{1x|Foo}}
      {{1x|Foo}}
      !! html
      Foo

      Foo

      !!end !!test Templates: P-wrapping: 1a. Templates on consecutive lines !! wikitext {{1x|Foo}} {{1x|bar}} !! html

      Foo bar

      !!end !!test Templates: P-wrapping: 1b. Templates on consecutive lines !! wikitext Foo {{1x|bar}} {{1x|baz}} !! html

      Foo

      bar baz

      !!end !!test Templates: P-wrapping: 1c. Templates on consecutive lines !! wikitext {{1x|Foo}} {{1x|bar}}
      baz
      !! html

      Foo

      bar

      baz
      !! html/parsoid

      Foo

      bar

      baz
      !! end !! test Templates: P-wrapping: 1d. Template preceded by comment-only line !! wikitext {{1x|Bar}} !! html/php

      Bar

      !! html/parsoid

      Bar

      !!end !! test Templates: Scopes should not be expanded unnecessarily !! options parsoid=wt2html,wt2wt !! wikitext {{1x|
      a
      }}b{{1x|
      c
      }} !! html/php
      a

      b

      c
      !! html/parsoid
      a

      b

      c
      !! end !!test Templates: Inline Text: 1. Multiple template uses !! wikitext {{1x|Foo}}bar{{1x|baz}} !! html

      Foobarbaz

      !!end !!test Templates: Inline Text: 2. Back-to-back template uses !! wikitext {{1x|Foo}}{{1x|bar}} !! html

      Foobar

      !!end !!test Templates: Block Tags: 1. Multiple template uses !! wikitext {{1x|
      Foo
      }}
      bar
      {{1x|
      baz
      }} !! html
      Foo
      bar
      baz
      !!end !!test Templates: Block Tags: 2. Back-to-back template uses !! wikitext {{1x|
      Foo
      }}{{1x|
      bar
      }} !! html
      Foo
      bar
      !!end ## Parsoid drops empty elements in templates. !! test Templates: Correctly encapsulate templates producing

      tag without a corresponding

      tag !! wikitext {{1x|a b

      }} !! html/php

      a

      b

      !! html/parsoid

      a

      b

      !! end !! test Drop stripped tag markers, unless they have encapsulation info !! wikitext {{1x|}} !! html/php !! html/parsoid !! end !!test Templates: Links: 1. Simple example !! wikitext {{1x|[[Foo|bar]]}} !! html

      bar

      !!end !!test Templates: Links: 2. Generation of link href !! wikitext [[{{1x|Foo}}|bar]] !! html

      bar

      !!end !! article Foobar !! text Dummy article to suppress redlinks in tests !! end !! article Foobarbaz !! text Dummy article to suppress redlinks in tests !! end !!test Templates: Links: 3. Generation of part of a link href !! wikitext [[Fo{{1x|o}}|bar]] [[Foo{{1x|bar}}]] [[Foo{{1x|bar}}baz]] [[Foo{{1x|bar}}|bar]] [[:Foo{{1x|bar}}]] [[:Foo{{1x|bar}}|bar]] !! html/php

      bar

      Foobar

      Foobarbaz

      bar

      Foobar

      bar

      !! html/parsoid

      bar

      Foobar

      Foobarbaz

      bar

      Foobar

      bar

      !!end !!test Templates: Links: 4. Multiple templates generating link href !! wikitext [[{{1x|F}}{{1x|o}}ob{{1x|ar}}]] !! html/php

      Foobar

      !! html/parsoid

      Foobar

      !!end !!test Templates: Links: 5. Generation of link text !! wikitext [[Foo|{{1x|bar}}]] !! html

      bar

      !!end !!test Templates: Links: 5. Nested templates (only outermost template should be marked) !! wikitext {{1x|[[{{1x|Foo}}|bar]]}} !! html

      bar

      !!end !! test File with template filename !! wikitext [[File:{{1x|Foobar.jpg}}]] !! html/parsoid

      !! end !!test Templates: HTML Tag: 1. Generation of HTML attr. key !! wikitext
      foo
      !! html
      foo
      !!end !!test Templates: HTML Tag: 2. Generation of HTML attr. value !! wikitext
      foo
      !! html
      foo
      !!end !!test Templates: HTML Tag: 3. Generation of HTML attr key and value !! wikitext
      foo
      !! html
      foo
      !!end !!test Templates: HTML Tag: 4. Generation of starting piece of HTML attr value !! wikitext
      foo
      !! html
      foo
      !!end !!test Templates: HTML Tag: 5. Generation of middle piece of HTML attr value !! wikitext
      foo
      !! html
      foo
      !!end !!test Templates: HTML Tag: 6. Generation of end piece of HTML attr value !! wikitext
      foo
      !! html
      foo
      !!end # SSS FIXME: While it is great we added support for all this, # do we want to make this part of the spec? Maybe we want to # deprecate this kind of usage in the future? !!test Templates: HTML Tag: 7. Generation of partial attribute key string !! wikitext
      foo
      !! html
      foo
      !!end !! test Templates: HTML Tag: 8. Template-generated attribute (k=v) !! wikitext
      bar
      !! html
      bar
      !!end !! test Templates: HTML Tag: 9. Multiple template-generated attributes !! wikitext
      bar
      !! html
      bar
      !!end !! test Templates: Support for templates generating attributes and content !! wikitext {| {{mixed_attr_content_template}} |- |bar |} !! html/php
      foo
      bar
      !! html/parsoid
      foo
      bar
      !!end !! test Templates: Support for templates generating table attributes and content (with fostered categories) !! wikitext {| {{mixed_attr_content_template_2}} |- |bar |} !! html/php
      foo
      bar
      !! html/parsoid
      foo
      bar
      !!end !! article Template:attribute_from_template !! text class="123" !! endarticle !! test Table cell with attribute before expanded attribute !! wikitext {| | align="center" {{attribute_from_template}} |456 |} !! html/parsoid
      456
      !! end # In integrated mode, the {{=}} template is expanded before Parsoid sees it !! test 1. Entities and nowikis inside templated attributes should be handled correctly !! wikitext
      foo
      !! html/php
      foo
      !! html/parsoid+standalone
      foo
      !! html/parsoid+integrated
      foo
      !! end !! test 2. Entities and nowikis inside templated attributes should be handled correctly !! wikitext {| |{{table_attribs_3}} |} !! html/php
      Foo
      !! html/parsoid
      Foo
      !! end !! test 3. Entities and nowikis inside templated attributes should be handled correctly inside templated tables !! wikitext {{tbl-start}} |{{table_attribs_3}} {{tbl-end}} !! html/php
      Foo
      !! html/parsoid
      Foo
      !! end # T107622 !! test 4. Entities and nowikis inside templated attributes should be handled correctly inside templated tables !! wikitext {| |{{table_attribs_6}} hi |} !! html/php
      hi
      !! html/parsoid
      hi
      !! end !! test Extension tag in templated tag attribute !! wikitext {{1x|1= {{{!}} class="123" {{!}} hi {{!}}} }} !! html/php
      hi
      !! html/parsoid
      hi
      !! end !!test Templates: HTML Tables: 1. Generating start of a HTML table !! wikitext {{1x|}}
      foo
      !! html
      foo
      !!end !!test Templates: HTML Tables: 2a. Generating middle of a HTML table !! wikitext {{1x|}}
      foo
      !! html
      foo
      !!end !!test Templates: HTML Tables: 2b. Generating middle of a HTML table !! wikitext {{1x|}}
      foo
      !! html
      foo
      !!end !!test Templates: HTML Tables: 3. Generating end of a HTML table !! wikitext {{1x|
      foo
      }} !! html
      foo
      !! end !!test Templates: HTML Tables: 4a. Generating a single tag of a HTML table !! wikitext {{1x|}}
      foo
      !! html
      foo
      !! end !!test Templates: HTML Tables: 4b. Generating a single tag of a HTML table !! wikitext {{1x|}}
      foo
      !! html
      foo
      !! end !!test Templates: HTML Tables: 4c. Generating a single tag of a HTML table !! wikitext {{1x|
      }}foo
      !! html
      foo
      !! end !!test Templates: HTML Tables: 4d. Generating a single tag of a HTML table !! wikitext }}
      foo{{1x|
      !! html
      foo
      !! end !!test Templates: HTML Tables: 4e. Generating a single tag of a HTML table !! wikitext {{1x|}}
      foo
      !! html
      foo
      !! end !!test Templates: HTML Tables: 4f. Generating a single tag of a HTML table !! wikitext {{1x|
      foo
      }} !! html
      foo
      !! end !!test Templates: HTML Tables: 5. Proper fostering of categories from inside !!options parsoid=wt2html,wt2wt !! wikitext [[Category:foo1]]
      foo
      [[Category:bar1]][[Category:bar2]]
      foo
      !! html/php
      foo
      foo
      !! html/parsoid
      foo
      foo
      !!end ## Remex doesn't account for fostered content. !! test Templates: Wiki Tables: 1a. Fostering of entire template content !! wikitext {| {{1x|a}} |} !! html/php a
      !! html/parsoid

      a

      !! end !!test Templates: Wiki Tables: 1b. Fostering of entire template content !! wikitext {| {{1x|
      }} foo {{1x|
      }} |} !! html/php

      foo

      !! html/parsoid

      foo

      !! end ## Remex doesn't account for fostered content. !! test Templates: Wiki Tables: 2. Fostering of partial template content !! wikitext {| {{1x|a
      b
      }} |} !! html/php a
      b
      !! html/parsoid

      a

      b
      !! end !!test Templates: Wiki Tables: 3. td-content via multiple templates !! wikitext {| {{1x|{{pipe}}a}}{{1x|b}} |} !! html
      ab
      !! end !!test Templates: Wiki Tables: 4. Templated tags, no content !! wikitext {{tbl-start}} {{tbl-end}} !! html/php
      !! html/parsoid
      !! end !!test Templates: Wiki Tables: 5. Templated tags, regular td-tags !! wikitext {{tbl-start}} |foo {{tbl-end}} !! html
      foo
      !! end !!test Templates: Wiki Tables: 6. Templated tags, templated td-tags !! wikitext {{tbl-start}} {{!}}foo {{tbl-end}} !! html
      foo
      !! end ## This test case is very specific to Parsoid's internals ## and is hence only tested for Parsoid's code. Parsoid uses ## a marker tag for tags and they are expanded ## much later. We are verifying that this tag usage ## doesn't prevent foster parenting. !! test Templates: Wiki Tables: 7. Fosterable s should get fostered !! wikitext {{PartialTable}}foo |} !! html/parsoid

      [1]

      1. foo
      !! end !!article Template:UnclosedTableEndsWithTR !!text {| |- !!endarticle !! test Templates: Wiki Tables: 8. Fosterable meta-tags should get fostered !! wikitext {{UnclosedTableEndsWithTR}} |foo |} {{UnclosedTableEndsWithTR}} |foo |} !! html/parsoid
      foo
      foo
      !! end ## Parsoid standalone mode seems to drop nonexisting templates !! test Templates: Lists: Multi-line list-items via templates !! wikitext *{{1x|a {{nonexistent| unused}}}} *{{1x|b {{nonexistent| unused}}}} !! html/php !! html/parsoid !! end !!test Templates: Ugly nesting: 1. Quotes opened/closed across templates (1x) !! wikitext {{1x|''a}}{{1x|b''c''d}}{{1x|''e}} !! html

      abcde

      !!end ## Legacy parser generates misnested html !! test Templates: Ugly nesting: 2. Quotes opened/closed across templates (1x_with_span) !! wikitext {{1x_with_span|''a}}{{1x_with_span|b''c''d}}{{1x_with_span|''e}} !! html/parsoid

      abcde

      !! end ## Legacy parser generates misnested html; Parsoid html2wt mode adds newlines between {{1x}}s !! test Templates: Ugly nesting: 3. Quotes opened/closed across templates (1x_with_div) !! options parsoid=wt2html,wt2wt !! wikitext {{1x_with_div|''a}}{{1x_with_div|b''c''d}}{{1x_with_div|''e}} !! html/php
      a
      bcd
      e
      !! html/parsoid
      a
      bcd
      e
      !! end !! test Templates: Ugly nesting: 4. Divs opened/closed across templates !! wikitext a
      b{{1x|c
      d}}e !! html

      a

      bc

      de

      !! end !! test Templates: Ugly templates: 3. newline-only template parameter !! wikitext foo {{1x| }} !! html

      foo

      !! end # This looks like a bug: a single newline triggers p/br for some reason. !! test Templates: Ugly templates: 4. newline-only template parameter inconsistency !! wikitext {{1x| }} !! html


      !! end # T66017 -- ugly wikitext with fostered content generates two template ranges that # have a true overlap (T1-start - T2-start - T1-end - T2-end). !! test Templates: Ugly templates: 5. Template encapsulation test: Non-trivial overlap of template ranges is properly handled !! wikitext {{1x|}} {{1x|
      foo}} {{1x|
      }} !! html/parsoid
      foo
      !! end # T66017 -- ugly wikitext with fostered content generates two template ranges # that are "identical" and generate nesting cycles in the algorithm !! test Templates: Ugly templates: 6. Template encapsulation test: Cyclical nesting of template ranges is properly handled !! wikitext {{1x|
      }} {{1x|
      }} {{1x|
      }} !! html/parsoid
      !! end !! test Templates: Parameters substituted at the top-level !! wikitext {{{foo|''who'' {{1x|me}}? '''never!'''}}} {{{foo|bar|baz}}} !! html/php

      who me? never!

      bar

      !! html/parsoid

      who me? never!

      bar

      !! end !! test Templates: Param with empty arg in the final position !! wikitext {{{hi|}}} !! html/parsoid !! end !! test Compound transclusion with template and top level templatearg !! wikitext {{1x|}} {{{top|}}}
      123
      !! html/php
      123
      !! html/parsoid
      123
      !! end !!test Parser Functions: 1. Simple example !! wikitext {{uc:foo}} !! html

      FOO

      !!end !!test Parser Functions: 2. Nested use (only outermost should be marked up) !! wikitext {{uc:{{lc:FOO}}}} !! html

      FOO

      !!end ## Note that the templates inside the references are not wrapped !! test Template nested in extension tag in template !! options title=[[Main Page]] language=zh !! wikitext {{1x|hi[[ho|{{1x|hi}}]]}} {{1x|hi[http://test.com?q={{1x|ho}}]}} {{1x|hi-{ho|{{1x|hi}}}-}} !! html/parsoid

      hi[1] hi[2] hi[3]

      !! end !! test Parsoid: Recognize nowiki with odd capitalization !! options parsoid=wt2html !! wikitext
      [[foo]] !! html/php

      <div>[[foo]]

      !! html/parsoid

      <div>[[foo]]

      !! end !! test Parsoid: Escape nowiki with trailing space in tags !! options parsoid=html2wt !! html/parsoid

      <nowiki > foo </nowiki >

      a<nowiki />b

      c<nowiki/ >d

      !! wikitext <nowiki > foo </nowiki > a<nowiki />b c<nowiki/ >d !! end !! test Parsoid: Escape weird noWikI capitalizations !! options parsoid=html2wt !! html/parsoid

      <noWikI > foo </NoWikI >

      !! wikitext <noWikI > foo </NoWikI > !! end ### ### Message transform tests ### !! test message transform: magic variables !! options msg !! wikitext {{SITENAME}} !! html MediaWiki !! end !! test message transform: should not transform wiki markup !! options msg !! wikitext ''test'' !! html ''test'' !! end !! test message transform: in transcluded template (T6926) !! options msg !! wikitext {{Includes}} !! html/php Foobar !! html/parsoid

      Foobar

      !! end !! test message transform: in transcluded template (T6926) !! options msg !! wikitext {{Includes2}} !! html/php Foo !! html/parsoid+standalone

      Foo

      !! html/parsoid+integrated

      Foo

      !! end !! test {{#special:}} page name, known !! options msg !! wikitext {{#special:Recentchanges}} !! html/php Special:RecentChanges !! html/parsoid

      Special:RecentChanges

      !! end !! test {{#special:}} page name with subpage, known !! options msg !! wikitext {{#special:Recentchanges/param}} !! html/php Special:RecentChanges/param !! html/parsoid+integrated

      Special:RecentChanges/param

      !! end !! test {{#special:}} page name, unknown !! options msg !! wikitext {{#special:foobar nonexistent}} !! html/php Special:Foobar nonexistent !! html/parsoid+integrated

      Special:Foobar nonexistent

      !! end !! test {{#speciale:}} page name, known !! options msg !! wikitext {{#speciale:Recentchanges}} !! html/php Special:RecentChanges !! html/parsoid+integrated

      Special:RecentChanges

      !! end !! test {{#speciale:}} page name with subpage, known !! options msg !! wikitext {{#speciale:Recentchanges/param}} !! html/php Special:RecentChanges/param !! html/parsoid+integrated

      Special:RecentChanges/param

      !! end !! test {{#speciale:}} page name, unknown !! options msg !! wikitext {{#speciale:foobar nonexistent}} !! html/php Special:Foobar_nonexistent !! html/parsoid+integrated

      Special:Foobar_nonexistent

      !! end ### ### Subpages ### !! article Subpage test/subpage !! text foo !! endarticle !! test Subpage link !! options subpage title=[[Subpage test]] !! wikitext [[/subpage]] !! html

      /subpage

      !! end !! test Subpage noslash link !! options subpage title=[[Subpage test]] !! wikitext [[/subpage/]] !! html

      subpage

      !! end !! article Subpage test/1/2/subpage !! text blah !! endarticle !! test Relative subpage noslash link !! options parsoid=wt2wt,wt2html,html2html subpage title=[[Subpage test/1/2/3/4]] !! wikitext [[../../subpage/]] [[../../subpage]] !! html/php

      subpage

      Subpage test/1/2/subpage

      !! html/parsoid

      subpage

      Subpage test/1/2/subpage

      !! end !! test Parsoid: dot-slash prefixed wikilinks !! wikitext [[./foo]] [[././bar]] [[././baz/]] !! html/php

      [[./foo]]

      [[././bar]]

      [[././baz/]]

      !! html/parsoid

      [[./foo]]

      [[././bar]]

      [[././baz/]]

      !! end !! test Render invalid page names as plain text (T53090) !! wikitext [[./../foo|bar]] [[foo�|bar]] [[foo/.|bar]] [[foo/..|bar]] [[foo~~~bar]] [[foo>bar]] [[foo[bar]] [[.]] [[..]] [[foo././bar]] [[foo[http://example.com]xyz]] [[{{1x|./../foo}}|bar]] [[{{1x|foo/.}}|bar]] [[{{1x|foo/..}}|bar]] [[{{1x|foo~~~~bar}}]] [[{{1x|foo>bar}}]] [[{{1x|foo././bar}}]] [[{{1x|foo{bar}}]] [[{{1x|foo}bar}}]] [[{{1x|foo[bar}}]] [[{{1x|foo]bar}}]] [[{{1x|foo[[./../foo|bar]] [[foo�|bar]] [[foo/.|bar]] [[foo/..|bar]] [[foo~~~bar]] [[foo>bar]] [[foo[bar]] [[.]] [[..]] [[foo././bar]] [[foo[1]xyz]]

      [[./../foo|bar]] [[foo/.|bar]] [[foo/..|bar]] [[foo~~~~bar]] [[foo>bar]] [[foo././bar]] [[foo{bar]] [[foo}bar]] [[foo[bar]] [[foo]bar]] [[foo<bar]]

      !!html/parsoid

      [[./../foo|bar]] [[foo�|bar]] [[foo/.|bar]] [[foo/..|bar]] [[foo~~~bar]] [[foo>bar]] [[foo[bar]] [[.]] [[..]] [[foo././bar]] [[fooxyz]]

      [[./../foo|bar]] [[foo/.|bar]] [[foo/..|bar]] [[foo~~~~bar]] [[foo>bar]] [[foo././bar]] [[foo{bar]] [[foo}bar]] [[foo[bar]] [[foo]bar]] [[foo<bar]]

      !!end !! test Disabled subpages !! wikitext [[/subpage]] !! html/php

      /subpage

      !! html/parsoid

      /subpage

      !! end !! test T2561: {{/Subpage}} !! options subpage title=[[Page]] !! wikitext {{/Subpage}} !! html/php

      Page/Subpage

      !! html/parsoid

      Page/Subpage

      !! end !! test Subpage with namespaces !! options subpage title=[[Subpage test/1/2/3/4]] !! wikitext [[User:../subpage]] [[meatball:../subpage]] !! html

      [[User:../subpage]] [[meatball:../subpage]]

      !! end ### ### Categories ### !! article Category:MediaWiki User's Guide !! text blah !! endarticle !! test Link to category !! wikitext [[:Category:MediaWiki User's Guide]] !! html

      Category:MediaWiki User's Guide

      !! end !! test Simple category !! options cat !! wikitext [[Category:MediaWiki User's Guide]] !! html/php cat=MediaWiki_User's_Guide sort= !! html/parsoid !! end !! test PAGESINCATEGORY invalid title fatal (r33546 fix) !! wikitext {{PAGESINCATEGORY:}} !! html

      0

      !! end !! test Category with different sort key !! options cat !! wikitext [[Category:MediaWiki User's Guide|Foo]] !! html/php cat=MediaWiki_User's_Guide sort=Foo !! html/parsoid !! end !! test Category with identical sort key !! options cat !! wikitext [[Category:MediaWiki User's Guide|MediaWiki User's Guide]] !! html/php cat=MediaWiki_User's_Guide sort=MediaWiki User's Guide !! html/parsoid !! end !! test Category with newline in sort key !! options cat parsoid=wt2html,html2html !! wikitext [[Category:Wikidata:Tools| *]] !! html/php cat=Wikidata:Tools sort=* !! html/parsoid !! end !! test Category with template-generated sort key !! options cat !! wikitext [[Category:MediaWiki User's Guide|MediaWiki {{1x|Foo}} Guide]] !! html/php cat=MediaWiki_User's_Guide sort=MediaWiki Foo Guide !! html/parsoid !! end ## We used to, but no longer wt2wt this test since the default serializer ## will normalize all categories to serialize on their own line. ## This wikitext usage is going to be fairly uncommon in production and ## selser will take care of preserving formatting in those scenarios. !! test Category / paragraph interactions !! options parsoid=wt2html !! wikitext Foo [[Category:Baz]] Bar Foo [[Category:Baz]] Bar Foo [[Category:Baz]] Bar Foo [[Category:Baz]] Bar Foo [[Category:Baz]] [[Category:Baz]] [[Category:Baz]] Bar [[Category:Baz]] [[Category:Baz]] [[Category:Baz]] [[Category:Baz]] {{1x|[[Category:Baz]]}} [[Category:Baz]] !! html/php

      Foo Bar

      Foo Bar

      Foo Bar

      Foo Bar

      Foo Bar

      !! html/parsoid

      Foo Bar

      Foo Bar

      Foo Bar

      Foo Bar

      Foo Bar

      !! end ## We used to, but no longer wt2wt this test since the default serializer ## will normalize all categories to serialize on their own line. ## This wikitext usage is going to be fairly uncommon in production and ## selser will take care of preserving formatting in those scenarios. ## ## The whitespace on the empty line is part of the test. Please do not delete !! test 1. Categories and newlines: All preceding newlines should be suppressed (courtesy T2087) !! options parsoid=wt2html !! wikitext This [[Category:Foo]] and this should be part of same paragraph (not an indent-pre) {{1x|[[Category:Foo]] and so should this!}} !! html/php

      This and this should be part of same paragraph (not an indent-pre) and so should this!

      !! html/parsoid

      This and this should be part of same paragraph (not an indent-pre) and so should this!

      !! end ## Parsoid will not try to wt2wt this while preserving newlines because ## it suppresses excess newlines within list items -- and we don't want to ## introduce a special case just for categories, which is, in reality somewhat ## odd behavior -- categories are unlikely to be used in list items like this ## in top-level pages and are only likely to show up in template-generated ## list items where this RT-ing is a non-issue. ## ## The whitespace on the empty line is part of the test. Please do not delete !! test 2. Categories and newlines: All preceding newlines should be suppressed (courtesy T2087) !! options parsoid=wt2html !! wikitext * This [[Category:Foo]] and this should be part of the same list item * So should this {{1x|[[Category:Foo]] and this should be part of the same list item}} !! html/php
      • This and this should be part of the same list item
      • So should this and this should be part of the same list item
      !! html/parsoid
      • This and this should be part of the same list item
      • So should this and this should be part of the same list item
      !! end ## Newlines and categories that follow the last item of a list ## are treated differently because this (list followed by categories) ## is an extremely common pattern on wikis. !! test 3. Categories and newlines: newline suppression for last list item should RT properly !! wikitext *a *b [[Category:Foo]] [[Category:Bar]] [[Category:Baz]] :c [[Category:C]] ;d [[Category:D]] !! html/parsoid
      • a
      • b
      c
      d
      !! end !! test 4. Categories and newlines: newline suppression for last list item should RT properly !! wikitext *a ****b [[Category:Foo]] !! html/parsoid
      • a
            • b
      !! end ## only wt2html for this to make sure the algo only applies to the rightmost path !! test 5. Categories and newlines: migrateTrailingCategories dom pass should only run on the rightmost path of nested lists !! options parsoid=wt2html !! wikitext *a **b [[Category:Foo]] *c **d [[Category:Foo]] !! html/parsoid
      • a
        • b
      • c
        • d
      !! end ## We used to, but no longer wt2wt this test since the default serializer ## will normalize all categories to serialize on their own line. ## This wikitext usage is going to be fairly uncommon in production and ## selser will take care of preserving formatting in those scenarios. !! test 6. Categories and newlines: migrateTrailingCategories dom pass should not migrate categories not preceded by newlines !! options parsoid=wt2html !! wikitext *a [[Category:Foo]] !! html/parsoid
      • a
      !! end # This test also demonstrates because of newline+category tunneling # through the list hander, template wrapping doesn't expand to the # containing list when the list item swallows the category. !! test 7. Categories and newlines: migrateTrailingCategories dom pass should leave template content alone !! wikitext *{{1x|a [[Category:Foo]]}} !! html/parsoid
      • a
      !! end !! test 8. Categories and newlines: migrateTrailingCategories dom pass should not get tripped by intervening templates !! wikitext *a {{1x|[[Category:Foo]] [[Category:Bar]]}} [[Category:Baz]] !! html/parsoid
      • a
      !! end !! test Categories and newlines: migrateTrailingCategories dom pass should not get tripped by comments and whitespace !! wikitext *a [[Category:Bar]] [[Category:Baz]] !! html/parsoid
      • a
      !! end !! test Categories and newlines: should behave properly with linkprefix (T87753) !! options language=ar !! wikitext foo bar foo bar [[تصنيف:Foo]] [[تصنيف:Bar]] !! html/php

      foo bar foo bar

      !! html/parsoid

      foo bar foo bar

      !! end !! test No regressions on internal links following category (T174639) !! options parsoid=wt2html,html2html !! wikitext [[Category:Foo]]
      a [[Foo]]
      !! html/php
      a Foo
      !! html/parsoid
      a Foo
      !! end # Note that Parsoid differs slightly from PHP due to T175421 !! test 11. Special case where only newlines separate links (T175416) !! options parsoid=wt2html,html2html !! wikitext [[Category:Foo]] [[Foo]][[es:Alimento]] [[Foo]] !! html/php


      Foo

      Foo

      !! html/parsoid

      Foo

      Foo

      !! end !! test Category links with multiple namespaces !! wikitext [[Category:Project:Foo]] !! html/parsoid !! end !! test Parsoid: Serialize link to category page with colon escape !! wikitext [[:Category:Foo]] [[:Category:Foo|Bar]] !! html/php

      Category:Foo Bar

      !! html/parsoid

      Category:Foo Bar

      !! end # We used to, but no longer wt2wt this test since the default serializer # will normalize all categories to serialize on their own line. # This wikitext usage is going to be fairly uncommon in production and # selser will take care of preventing whitespace insertion if this # occurs in an article. # # html2html disabled for the same reason (whitespace insertion between # x and y). # # html2wt disabled because it localizes the "Category" namespace. !! test Link prefix/suffixes aren't applied to category links !! options parsoid=wt2html language=is !! wikitext x[[Category:Foo]]y !! html/php

      xy

      !! html/parsoid

      xy

      !! end !! test Link prefix/suffixes aren't applied to language links !! options parsoid=wt2html language=is !! wikitext x[[es:Foo]]y !! html/php

      xy

      !! html/parsoid

      xy

      !! end !! test Parsoid: Serialize link to file page with colon escape !! wikitext [[:File:Foo.png]] [[:File:Foo.png|Bar]] !! html/php

      File:Foo.png Bar

      !! html/parsoid

      File:Foo.png Bar

      !! end !! test Parsoid: Serialize a genuine category link without colon escape !! wikitext [[Category:Foo]] [[Category:Foo|Bar]] !! html/php !! html/parsoid !! end !! test Normalize hrefs properly before testing for invalid link targets (T72894) !! options parsoid=html2wt !! html/parsoid !! wikitext [[Category:Toxine bactérienne]] !! end !! article Template:emptytemplate !! text !! endarticle !! test Empty templates should be handled properly without being redlinked !! options parsoid=wt2html !! wikitext {{emptytemplate}} !! html/php !! html/parsoid !! end !! test Parsoid: Defaultsort !! wikitext {{DEFAULTSORT:Foo}} !! html/parsoid !! end !! test Parsoid: Defaultsort variations (T236846) !! wikitext {{DEFAULTSORT}} {{DEFAULTSORT:}} {{DEFAULTSORT:DOGGIE}} !! html/php

      Template:DEFAULTSORT


      !! html/parsoid

      Template:DEFAULTSORT

      !! end !! test Parsoid: Defaultsort with key content being added (T236846) !! options parsoid=html2wt !! html/parsoid !! wikitext {{DEFAULTSORT:BIRD}} !! end # NOTE: mw:ExpandedAttrs is not the best typeof here. mw:Transclusion is better. # But, this is a limitation of our representation and is documented in # TemplateHandler.php in processSpecialMagicWord !! test Parsoid: Defaultsort (template-generated) !! wikitext {{{{1x|DEFAULTSORT}}:Foo}} !! html/parsoid !! end ### ### Inter-language links ### !! test Interlanguage links !! options ill !! wikitext [[es:Alimento]] [[fr:Nourriture]] [[zh:食品]] !! html/php es:Alimento fr:Nourriture zh:食品 !! html/parsoid !! end !! test Duplicate interlanguage links (T26502) !! options ill !! wikitext [[es:1]] [[es:2]] [[fr:1]] [[fr:2]] !! html/php es:1 fr:1 !! html/parsoid !! end ### ### Sections ### !! test Basic section headings !! wikitext ==Headline 1== Some text ==Headline 2== More ===Smaller headline=== Blah blah !! html

      Headline 1[edit]

      Some text

      Headline 2[edit]

      More

      Smaller headline[edit]

      Blah blah

      !! end !! test Section headings with TOC !! wikitext ==Headline 1== ===Subheadline 1=== =====Skipping a level===== ======Skipping a level====== ==Headline 2== Some text ===Another headline=== !! html

      Headline 1[edit]

      Subheadline 1[edit]

      Skipping a level[edit]
      Skipping a level[edit]

      Headline 2[edit]

      Some text

      Another headline[edit]

      !! end !! test Section headings with TOC and language conversion (T295187, T306862) !! config wgUsePigLatinVariant=true !! options language=en variant=en-x-piglatin !! wikitext ==Headline 1== ===Subheadline 1=== ==Headline 2== Some text ===Another headline=== !! html

      Eadlinehay 1[edit]

      Ubheadlinesay 1[edit]

      Eadlinehay 2[edit]

      Omesay exttay

      Anotherway eadlinehay[edit]

      !! end # Note that even though conversion of the *content* is disabled, the # user interface messages (aka the TOC title) are still in the user's # preferred UX variant (that is, pig latin). !! test Section headings with TOC and language conversion disabled (T295187) !! config wgUsePigLatinVariant=true !! options language=en variant=en-x-piglatin !! wikitext ==Headline 1== ===Subheadline 1=== ==Headline 2== Some text ===Another headline=== __NOCONTENTCONVERT__ !! html

      Headline 1[edit]

      Subheadline 1[edit]

      Headline 2[edit]

      Some text

      Another headline[edit]

      !! end # The -{T}- below checks for regressions in T26072: the contents of # the displaytitle should not be double-converted. That is, we want # the title to end up as 'Bar' not 'Ball' (aka converted by the -{H}- # rule immediately preceding it). !! test Section headings with TOC, language conversion rules, and displaytitle (T306862, T331316, T26072) !! config wgUsePigLatinVariant=true wgRestrictDisplayTitle=false !! options language=en variant=en-x-piglatin showtitle showtocdata parsoid={ "modes": [ "wt2html" ], "wrapSections": true } !! wikitext -{H|Foo=>en:Boo;Foo=>en-x-piglatin:Bob;}--{H|Bar=>en:Bat;Bar=>en-x-piglatin:Ball;}--{T|en:Foo;en-x-piglatin:Bar;}- Introduction. -{A|en:Do; en-x-piglatin:Re;}- == Foo == Foo Do == Bar == Bar Re == -{Foo Bar}- == !! metadata Bar Sections: h2 index:1 toclevel:1 number:1 title:Parser_test off:192 anchor/linkAnchor:Foo line:Bob h2 index:2 toclevel:1 number:2 title:Parser_test off:209 anchor/linkAnchor:Bar line:Ball h2 index:3 toclevel:1 number:3 title:Parser_test off:226 anchor/linkAnchor:-.7BFoo_Bar.7D- line:Foo Bar !! html/php

      Introductionway. Re

      Bob[edit]

      Bob Re

      Ball[edit]

      Ball Eray

      Foo Bar[edit]

      !! end !! test TOC anchors don't collide !! wikitext __FORCETOC__ ==Headline 2== ==Headline== ==Headline 2== ==Headline== !! html/php

      Headline 2[edit]

      Headline[edit]

      Headline 2[edit]

      Headline[edit]

      !! end # perl -e 'print "="x$_," Level $_ heading","="x$_,"\n" for 1..10' # Parsoid html2wt direction adds for level 7 and up. !! test Handling of sections up to level 6 and beyond !! options parsoid=wt2html !! wikitext =Level 1 Heading= ==Level 2 Heading== ===Level 3 Heading=== ====Level 4 Heading==== =====Level 5 Heading===== ======Level 6 Heading====== =======Level 7 Heading======= ========Level 8 Heading======== =========Level 9 Heading========= ==========Level 10 Heading========== !! html/php

      Level 1 Heading[edit]

      Level 2 Heading[edit]

      Level 3 Heading[edit]

      Level 4 Heading[edit]

      Level 5 Heading[edit]
      Level 6 Heading[edit]
      =Level 7 Heading=[edit]
      ==Level 8 Heading==[edit]
      ===Level 9 Heading===[edit]
      ====Level 10 Heading====[edit]
      !! html/parsoid

      Level 1 Heading

      Level 2 Heading

      Level 3 Heading

      Level 4 Heading

      Level 5 Heading
      Level 6 Heading
      =Level 7 Heading=
      ==Level 8 Heading==
      ===Level 9 Heading===
      ====Level 10 Heading====
      !! end !! test TOC regression (T11764) !! wikitext ==title 1== ===title 1.1=== ====title 1.1.1==== ===title 1.2=== ==title 2== ===title 2.1=== !! html

      title 1[edit]

      title 1.1[edit]

      title 1.1.1[edit]

      title 1.2[edit]

      title 2[edit]

      title 2.1[edit]

      !! end !! test TOC for heading containing (T96153) !! wikitext __FORCETOC__ ==New title== !! html/php

      New title[edit]

      !! end !! test TOC with wgMaxTocLevel=3 (T8204) !! options wgMaxTocLevel=3 !! wikitext ==title 1== ===title 1.1=== ====title 1.1.1==== ===title 1.2=== ==title 2== ===title 2.1=== !! html

      title 1[edit]

      title 1.1[edit]

      title 1.1.1[edit]

      title 1.2[edit]

      title 2[edit]

      title 2.1[edit]

      !! end !! test TOC with wgMaxTocLevel=3 and two level four headings (T8204) !! options wgMaxTocLevel=3 !! wikitext ==Section 1== ===Section 1.1=== ====Section 1.1.1==== ====Section 1.1.1.1==== ==Section 2== !! html

      Section 1[edit]

      Section 1.1[edit]

      Section 1.1.1[edit]

      Section 1.1.1.1[edit]

      Section 2[edit]

      !! end !! test Resolving duplicate section names !! wikitext ==Foo bar== ==Foo bar== !! html

      Foo bar[edit]

      Foo bar[edit]

      !! end !! test Resolving duplicate section names with differing case (T12721) !! wikitext ==Foo bar== ==Foo Bar== !! html

      Foo bar[edit]

      Foo Bar[edit]

      !! end !! article Template:sections !! text ===Section 1=== ==Section 2== !! endarticle !! test Template with sections, __NOTOC__ !! options showflags !! wikitext __NOTOC__ ==Section 0== {{sections}} ==Section 4== !! metadata flags= !! html/php

      Section 0[edit]

      Section 1[edit]

      Section 2[edit]

      Section 4[edit]

      !! end !! test T307691: show-toc flag: no sections !! options showflags !! wikitext !! metadata flags= !! html !! end # You can't force a TOC if there aren't any sections !! test T307691: show-toc flag: no sections, but __FORCETOC__ !! options showflags !! wikitext __FORCETOC__ !! metadata flags= !! html/php !! html/parsoid !! end # Placing a manual __TOC__ doesn't do anything if there aren't any sections !! test T307691: show-toc flag: no sections, but __TOC__ !! options showflags !! wikitext __TOC__ !! metadata flags= !! html/php !! html/parsoid !! end !! test T307691: show-toc flag: no sections, and __NOTOC__ !! options showflags !! wikitext __NOTOC__ !! metadata flags= !! html/php !! html/parsoid !! end !! test T307691: show-toc flag: not "enough" sections !! options showflags !! wikitext == One == !! metadata flags= !! html/php

      One[edit]

      !! html/parsoid

      One

      !! end !! test T307691: show-toc flag: not "enough" sections, but __FORCETOC__ !! options showflags !! wikitext __FORCETOC__ == One == !! metadata flags=show-toc !! html/php

      One[edit]

      !! html/parsoid

      One

      !! end !! test T307691: show-toc flag: not "enough" sections, but __TOC__ !! options showflags !! wikitext == One == __TOC__ !! metadata flags=show-toc !! html/php

      One[edit]

      !! html/parsoid

      One

      !! end !! test T307691: show-toc flag: not "enough" sections, and __NOTOC__ !! options showflags !! wikitext __NOTOC__ == One == !! metadata flags= !! html/php

      One[edit]

      !! html/parsoid

      One

      !! end !! test T307691: show-toc flag: "enough" sections !! options showflags !! wikitext == One == === Two === == Three == === Four === !! metadata flags=show-toc !! html/php

      One[edit]

      Two[edit]

      Three[edit]

      Four[edit]

      !! html/parsoid

      One

      Two

      Three

      Four

      !! end !! test T307691: show-toc flag: "enough" sections and __FORCETOC__ !! options showflags !! wikitext __FORCETOC__ == One == === Two === == Three == === Four === !! metadata flags=show-toc !! html/php

      One[edit]

      Two[edit]

      Three[edit]

      Four[edit]

      !! html/parsoid

      One

      Two

      Three

      Four

      !! end !! test T307691: show-toc flag: "enough" sections and __NOTOC__ !! options showflags !! wikitext __NOTOC__ == One == === Two === == Three == === Four === !! metadata flags= !! html/php

      One[edit]

      Two[edit]

      Three[edit]

      Four[edit]

      !! html/parsoid

      One

      Two

      Three

      Four

      !! end !! test __NOEDITSECTION__ keyword !! wikitext __NOEDITSECTION__ ==Section 1== ==Section 2== !! html

      Section 1

      Section 2

      !! end !! test Link inside a section heading !! wikitext ==Section with a [[Main Page|link]] in it== !! html

      Section with a link in it[edit]

      !! end !! test TOC regression (T14077) !! wikitext __TOC__ ==title 1== ===title 1.1=== ==title 2== !! html

      title 1[edit]

      title 1.1[edit]

      title 2[edit]

      !! end # Parsoid doesn't wt2wt this cleanly because it adds s. !! test Short headings with trailing space should match behavior of Parser::doHeadings (T21910) !! options parsoid=wt2html,html2html !! wikitext === The line above must have a trailing space! === But just in case it doesn't... !! html/php

      =[edit]

      The line above must have a trailing space!

      =[edit]

      But just in case it doesn't...

      !! html/parsoid

      =

      The line above must have a trailing space!

      =

      But just in case it doesn't...

      !! end !! test Header with special characters (T27462) !! wikitext The tooltips shall not show entities to the user (ie. be double escaped) ==text > text== section 1 ==text < text== section 2 ==text & text== section 3 ==text ' text== section 4 ==text " text== section 5 !! html/php

      The tooltips shall not show entities to the user (ie. be double escaped)

      text > text[edit]

      section 1

      text < text[edit]

      section 2

      text & text[edit]

      section 3

      text ' text[edit]

      section 4

      text " text[edit]

      section 5

      !! html/parsoid

      The tooltips shall not show entities to the user (ie. be double escaped)

      text > text

      section 1

      text < text

      section 2

      text & text

      section 3

      text ' text

      section 4

      text " text

      section 5

      !! end !! test Header with space, plus and underscore as entity !! wikitext Id should not contain + for spaces ==Space between Text== section 1 ==Space-Entity between Text== section 2 ==Plus+between+Text== section 3 ==Plus-Entity+between+Text== section 4 ==Underscore_between_Text== section 5 ==Underscore-Entity_between_Text== section 6 [[#Space between Text]] [[#Space-Entity between Text]] [[#Plus+between+Text]] [[#Plus-Entity+between+Text]] [[#Underscore_between_Text]] [[#Underscore-Entity_between_Text]] !! html/php

      Id should not contain + for spaces

      Space between Text[edit]

      section 1

      Space-Entity between Text[edit]

      section 2

      Plus+between+Text[edit]

      section 3

      Plus-Entity+between+Text[edit]

      section 4

      Underscore_between_Text[edit]

      section 5

      Underscore-Entity_between_Text[edit]

      section 6

      #Space between Text #Space-Entity between Text #Plus+between+Text #Plus-Entity+between+Text #Underscore_between_Text #Underscore-Entity_between_Text

      !! html/parsoid

      Id should not contain + for spaces

      Space between Text

      section 1

      Space-Entity between Text

      section 2

      Plus+between+Text

      section 3

      Plus-Entity+between+Text

      section 4

      Underscore_between_Text

      section 5

      Underscore-Entity_between_Text

      section 6

      #Space between Text #Space-Entity between Text #Plus+between+Text #Plus-Entity+between+Text #Underscore_between_Text #Underscore-Entity_between_Text

      !! end # Parsoid html2wt disabled because it adds padding spaces around = !! test Headers with excess '=' characters (Are similar tests necessary beyond the 1st level?) !! options parsoid=wt2html,wt2wt,html2html !! wikitext =foo== ==foo= =''italic'' heading== ==''italic'' heading= !! html/php

      foo=[edit]

      =foo[edit]

      italic heading=[edit]

      =italic heading[edit]

      !! html/parsoid

      foo=

      =foo

      italic heading=

      =italic heading

      !! end !! test HTML headers vs TOC (T25393) (__NOEDITSECTION__ for clearer output, doesn't matter here) !! wikitext

      Header 1

      ==Header 1.1== ==Header 1.2==

      Header 2

      ==Header 2.1== ==Header 2.2== __NOEDITSECTION__ !! html/php

      Header 1

      Header 1.1

      Header 1.2

      Header 2

      Header 2.1

      Header 2.2

      !! html/parsoid

      Header 1

      Header 1.1

      Header 1.2

      Header 2

      Header 2.1

      Header 2.2

      !! end !! test Single-line or multiline-comments can follow headings !! options parsoid=wt2html,wt2wt !! wikitext ==foo== ==bar== ==baz== !! html/php

      foo[edit]

      bar[edit]

      baz[edit]

      !! html/parsoid

      foo

      bar

      baz

      !! end !! test T3186 news: in the middle of text !! wikitext http://en.wikinews.org/wiki/Wikinews:Workplace !! html

      http://en.wikinews.org/wiki/Wikinews:Workplace

      !!end !! test Namespaced link must have a title !! wikitext [[Project:]] !! html

      [[Project:]]

      !!end !! test Namespaced link must have a title (bad fragment version) !! wikitext [[Project:#fragment]] !! html

      [[Project:#fragment]]

      !!end ### ### HTML tags and HTML attributes ### !! test div with no attributes !! wikitext
      HTML rocks
      !! html
      HTML rocks
      !! end !! test div with double-quoted attribute !! wikitext
      HTML rocks
      !! html
      HTML rocks
      !! end !! test div with single-quoted attribute !! wikitext
      HTML rocks
      !! html
      HTML rocks
      !! end !! test div with unquoted attribute !! wikitext
      HTML rocks
      !! html
      HTML rocks
      !! end !! test div with illegal double attributes !! wikitext
      HTML rocks
      !! html
      HTML rocks
      !! end !! test div with empty attribute value, space before equals !! options parsoid=wt2html,html2html !! wikitext
      HTML rocks
      !! html/php
      HTML rocks
      !! html/parsoid
      HTML rocks
      !! end !! test div with multiple empty attribute values !! config wgFragmentMode=[ "html5", "legacy" ] !! options parsoid=wt2html,html2html !! wikitext
      HTML rocks
      !! html/php
      HTML rocks
      !! html/parsoid
      HTML rocks
      !! end # FIXME Parsoid doesn't actually match PHP here. !! test Extension tag in attribute value !! options wgRawHtml=1 !! wikitext ok !! html/php

      ok

      !! html/parsoid

      ok

      !! end !! test table with multiple empty attribute values !! options parsoid=wt2html,html2html !! wikitext {| title= id= |hi |} !! html/php
      hi
      !! html/parsoid
      hi
      !! end !! test div with braces in attribute value !! wikitext
      Foo
      !! html/php
      Foo
      !! html/parsoid
      Foo
      !! end !! test div with empty attribute value, no space before equals !! options parsoid=wt2html,html2html !! wikitext
      HTML rocks
      !! html/php
      HTML rocks
      !! html/parsoid
      HTML rocks
      !! end !! test HTML multiple attributes correction !! wikitext

      Awesome!

      !! html

      Awesome!

      !! end !! test Table multiple attributes correction !! wikitext {| !+ class="error" class="awesome"|status |} !! html
      status
      !! end !! test DIV IN UPPERCASE !! wikitext
      HTML ROCKS
      !! html
      HTML ROCKS
      !! end !! test Non-ASCII pseudo-tags are rendered as text !! wikitext !! html

      <khyô>

      !! end !! test Pseudo-tag with URL 'name' renders as url link !! wikitext !! html

      <http://example.com/>

      !! end !! test text with amp in the middle of nowhere !! wikitext Remember AT&T? !! html

      Remember AT&T?

      !! end !! test text with character entity: eacute !! wikitext I always thought é was a cute letter. !! html

      I always thought é was a cute letter.

      !! end !! test text with entity-escaped character entity-like string: eacute !! wikitext I always thought &eacute; was a cute letter. !! html

      I always thought &eacute; was a cute letter.

      !! end !! test text with undefined character entity: xacute !! wikitext I always thought &xacute; was a cute letter. !! html

      I always thought &xacute; was a cute letter.

      !! end !! test Text with HTML5 semicolon-less entity (should not decode) !! wikitext &amp; !! html/php

      &ampamp;

      !! html/parsoid

      &ampamp;

      !! end !! test HTML5 tags !! wikitext five This highlighted text !! html

      five This highlighted text

      !! end !! test HTML tag with leading space is parsed as text !! wikitext < div>foo< /div> !! html

      < div>foo< /div>

      !! end ## FIXME: The untrimmed attribute in Parsoid is T205737 !! test Element with broken attribute syntax !! options parsoid=wt2html !! wikitext
      hi
      ho
      !! html/php
      hi
      ho
      !! html/parsoid
      hi
      ho
      !! end ### ### Nesting tests (see T43545, T52604, T53081) ### # This test case is fixed in Parsoid by domino 1.0.12. (T52604) # Note that html2wt is considerably more difficult if we use in # the test case, instead of !! test Ensure that HTML adoption agency algorithm is properly implemented. !! wikitext XYZ !! html

      XYZ

      !! end # This was T43545 in the PHP parser. !! test Nesting of !! wikitext XYZ !! html

      XYZ

      !! end # The following cases were T53081 in the PHP parser. # Note that there are some other nestable tags (b, i, etc) which are # not covered; see T53081 for discussion. !! test Nesting of !! wikitext XYZ !! html

      XYZ

      !! end !! test Nesting of !! wikitext XYZ !! html

      XYZ

      !! end !! test Nesting of !! wikitext XYZ !! html

      XYZ

      !! end !! test Nesting of !! wikitext XYZ !! html

      XYZ

      !! end !! test Nesting of !! wikitext XYZ !! html

      XYZ

      !! end ### ### Media links ### !! test Media link !! wikitext [[Media:Foobar.jpg]] [[Media:Video.ogv]] [[:Media:Video.ogv]] !! html/php

      Media:Foobar.jpg Media:Video.ogv Media:Video.ogv

      !! html/parsoid

      Media:Foobar.jpg Media:Video.ogv Media:Video.ogv

      !! end !! test Media link with text !! wikitext [[Media:Foobar.jpg|A neat file to look at]] !! html/php

      A neat file to look at

      !! html/parsoid

      A neat file to look at

      !! end # This won't pass in standalone mode because we don't have redirect handling in our mock data access. # Not sure if it is worth dealing with it. !! test Media link redirect !! wikitext [[Media:Redirect to foobar.jpg]] !! html/php

      Media:Redirect to foobar.jpg

      !! html/parsoid+integrated

      Media:Redirect to foobar.jpg

      !! end !! test Localized media link !! options language=is !! wikitext [[Miðill:Foobar.jpg]] [[Miðill:Foobar.jpg|Icelandic]] !! html/php

      Miðill:Foobar.jpg

      Icelandic

      !! html/parsoid

      Miðill:Foobar.jpg

      Icelandic

      !! end # FIXME: this is still bad HTML tag nesting # FIXME: doBlockLevels won't wrap this in a paragraph because it contains a div # Parsoid & Remex fix the p-wrapping since they operate on the DOM. !! test Media link with nasty text !! options parsoid=wt2html,html2html !! wikitext [[Media:Foobar.jpg|Safe Link
      " onmouseover="alert(document.cookie)" onfoo="
      ]] !! html/php

      Safe Link

      " onmouseover="alert(document.cookie)" onfoo="
      !! html/parsoid

      Safe Link

      " onmouseover="alert(document.cookie)" onfoo="
      !! end !! test Media link from missing resource (parsoid-only) !! options parsoid=html2wt !! html/parsoid Bat! !! wikitext [[Media:Foobar.jpg|Bat!]] !! end !! test Media link from missing resource, localized (parsoid-only) !! options parsoid=html2wt language=is !! html/parsoid Bat! !! wikitext [[Miðill:Foobar.jpg|Bat!]] !! end # This is a test to ensure we don't crash or choke when given # old cached 1.7.0 HTML for media links; we don't require that the # result be "valid" because wt2wt was completely broken in 1.7.0 !! test Media link from old 1.7.0 DOM spec (crash test, parsoid-only) T198511 !! options parsoid=html2wt !! html/parsoid

      This is what Parsoid would emit (and we still handle this HTML fine):

      A neat file to look at

      But VisualEditor would mangle the rel attribute, and give us back this:

      A neat file to look at

      But at least we don't crash when trying to handle the mangled HTML!

      !! wikitext This is what Parsoid would emit (and we still handle this HTML fine): [[Media:Foobar.jpg|A neat file to look at]] But VisualEditor would mangle the rel attribute, and give us back this: [http://example.com/images/3/3a/Foobar.jpg A neat file to look at] But at least we don't crash when trying to handle the mangled HTML! !! end !! test Media link to nonexistent file (T3702) !! wikitext [[Media:No such.jpg]] [[Media:No_such file.jpg]] !! html/php

      Media:No such.jpg Media:No_such file.jpg

      !! html/parsoid

      Media:No such.jpg Media:No_such file.jpg

      !! end !! test Media link with nested wikilinks !! config wgParserEnableLegacyMediaDOM=false !! wikitext [[Media:Foobar.jpg|[[Test]]]] [[Media:Foobar.jpg|[[File:Foobar.jpg]]]] !! html/php

      [[Media:Foobar.jpg|Test]] [[Media:Foobar.jpg|]]

      !! html/parsoid

      [[Media:Foobar.jpg|Test]] [[Media:Foobar.jpg|]]

      !! end !! test Media link with multiple options !! wikitext [[Media:Foobar.jpg|123|345]] !! html/php

      123|345

      !! html/parsoid

      123|345

      !! end !! test Character reference normalization in link text (T3938) !! wikitext [[Main Page|this&that]] !! html

      this&that

      !! end !! article אַ !! text Test for unicode normalization The page's name is U+05d0 U+05b7, with non-canonical form U+FB2E !! endarticle # Parsoid has a regression here (T258858) note the incorrect redlink as well !! test (T21451) Links should refer to the normalized form. !! wikitext [[אַ]] [[אַ]] [[אַ]] [[אַ]] [[אַ]] !! html/php

      אַ אַ אַ אַ

      !! html/parsoid

      אַ אַ אַ אַ

      !! end !! test Empty attribute crash test (T4067) !! wikitext foo !! html

      foo

      !! end !! test Empty attribute crash test single-quotes (T4067) !! wikitext foo !! html

      foo

      !! end !! test Attribute test: equals, then nothing !! options parsoid=wt2html,html2html !! wikitext foo !! html/php

      foo

      !! html/parsoid

      foo

      !! end !! test Attribute test: unquoted value !! options parsoid=wt2html,html2html !! wikitext foo !! html/php

      foo

      !! html/parsoid

      foo

      !! end !! test Attribute test: unquoted but illegal value (hash) !! wikitext foo !! html

      foo

      !! end # Parsoid does not serialize to empty attribute syntax, # so wt2wt and html2wt cases are skipped !! test Attribute test: no value (T54330) !! options parsoid=wt2html,html2html !! wikitext foo !! html/php

      foo

      !! html/parsoid

      foo

      !! end !! test T4095: link with three closing brackets !! wikitext [[Main Page]]] !! html/php

      Main Page]

      !! html/parsoid

      Main Page]

      !! end !! test T4095: link with pipe and three closing brackets !! wikitext [[Main Page|link]]] !! html/php

      link]

      !! html/parsoid

      link]

      !! end !! test T4095: link with pipe and three closing brackets, version 2 !! wikitext [[Main Page|[http://example.com/]]] !! html/php

      [http://example.com/]

      !! html/parsoid

      [http://example.com/]

      !! end ### ### Safety ### !! article Template:Dangerous attribute !! text " onmouseover="alert(document.cookie) !! endarticle !! article Template:Dangerous style attribute !! text border-size: expression(alert(document.cookie)) !! endarticle !! article Template:Div style !! text
      Magic div
      !! endarticle !! test T4304: HTML attribute safety (safe template; regression T4309) !! wikitext
      !! html/php
      !! html/parsoid
      !! end # Parsoid has enough context to handle this case !! test T4304: HTML attribute safety (dangerous template; 2309) !! wikitext
      !! html/php
      !! html/parsoid
      !! end !! test T4304: HTML attribute safety (dangerous style template; 2309) !! wikitext
      !! html/php
      !! html/parsoid
      !! end !! test T4304: HTML attribute safety (safe parameter; 2309) !! wikitext {{div style|width: 200px}} !! html/php
      Magic div
      !! html/parsoid
      Magic div
      !! end !! test T4304: HTML attribute safety (unsafe parameter; 2309) !! wikitext {{div style|width: expression(alert(document.cookie))}} !! html/php
      Magic div
      !! html/parsoid
      Magic div
      !! end !! test T4304: HTML attribute safety (unsafe breakout parameter; 2309) !! wikitext {{div style|">}} !! html/php
      <script>alert(document.cookie)</script>">Magic div
      !! html/parsoid+integrated
      <script>alert(document.cookie)</script>">Magic div
      !! end !! test T4304: HTML attribute safety (unsafe breakout parameter 2; 2309) !! wikitext {{div style|" >}} !! html/php
      <script>alert(document.cookie)</script>">Magic div
      !! html/parsoid+integrated
      <script>alert(document.cookie)</script>">Magic div
      !! end !! test T4304: HTML attribute safety (link) !! wikitext
      !! html/php
      !! html/parsoid
      !! end !! test T4304: HTML attribute safety (italics) !! wikitext
      !! html
      !! end !! test T4304: HTML attribute safety (bold) !! wikitext
      !! html
      !! end !! test T4304: HTML attribute safety (ISBN) !! wikitext
      !! html
      !! end !! test T4304: HTML attribute safety (RFC) !! wikitext
      !! html
      !! end !! test T4304: HTML attribute safety (PMID) !! wikitext
      !! html
      !! end !! test T4304: HTML attribute safety (web link) !! wikitext
      !! html
      !! end !! test T4304: HTML attribute safety (named web link) !! wikitext
      !! html/php
      !! html/parsoid
      !! end !! test T5244: HTML attribute safety (extension; safe) !! wikitext
      !! html/php
      !! html/parsoid
      !! end !! test T5244: HTML attribute safety (extension; unsafe) !! wikitext
      !! html/php
      !! html/parsoid
      !! end # More MSIE fun discovered by Tom Gilder !! test MSIE CSS safety test: spurious slash !! wikitext
      evil
      !! html/php
      evil
      !! html/parsoid
      evil
      !! end !! test MSIE CSS safety test: hex code !! wikitext
      evil
      !! html/php
      evil
      !! html/parsoid
      evil
      !! end !! test MSIE CSS safety test: comment in url !! wikitext
      evil
      !! html/php
      evil
      !! html/parsoid
      evil
      !! end !! test MSIE CSS safety test: comment in expression !! wikitext
      evil4
      !! html/php
      evil4
      !! html/parsoid
      evil4
      !! end !! test CSS safety test (all browsers): vertical tab (T57332 / CVE-2013-4567) !! wikitext

      A

      !! html/php

      A

      !! html/parsoid

      A

      !! end !! test Opera -o-link CSS !! options parsoid=wt2html,html2html !! wikitext
      X
      !! html/php
      X
      !! html/parsoid
      X
      !! end !! test Table attribute legitimate extension !! wikitext {| !+ style="color:blue"|status |} !! html
      status
      !! end !! test Table attribute safety !! wikitext {| !+ style="border-width:expression(0+alert(document.cookie))"|status |} !! html
      status
      !! end !! test CSS line continuation 1 !! wikitext
      !! html
      !! end !! test CSS line continuation 2 !! wikitext
      !! html
      !! end !! test Expansion of multi-line templates in attribute values (T8255) !! wikitext
      -
      !! html
      -
      !! html/parsoid
      -
      !! end !! test Expansion of multi-line templates in attribute values (T8255 check) !! wikitext
      -
      !! html/php
      -
      !! html/parsoid
      -
      !! end !! test Expansion of multi-line templates in attribute values (T8255 check 2) !! wikitext
      -
      !! html
      -
      !! end # BlockLevelPass suppresses P-wrapping for tags whose names begin with # `mw:`. We'll somewhat arbitrarily chose `mw:editsection` to # represent this class of tags for testing purposes. !! test Tags which are hidden from tidiers cannot pass through the Sanitizer !! options parsoid=wt2html,html2html !! wikitext !! html/php

      <mw:editsection><script>alert();</script></mw:editsection>

      <meta property="mw:PageProp/toc" />

      !! html/parsoid

      <mw:editsection><script>alert();</script></mw:editsection>

      <meta property="mw:PageProp/toc" />

      !! end ### ### Parser hooks (see tests/parser/ParserTestParserHook.php for the extension) ### !! test Parser hook: empty input !! wikitext !! html/php
      ''
      array (
      )
      
      !! html/parsoid
      ''
      array (
      )
      !! end ## Don't expect parsoid to rt this form. !! test Parser hook: empty input using terminated empty elements !! options parsoid=wt2html,html2html !! wikitext !! html/php
      NULL
      array (
      )
      
      !! html/parsoid
      NULL
      array (
      )
      
      !! end !! test Parser hook: empty input using terminated empty elements (space before) !! wikitext !! html/php
      NULL
      array (
      )
      
      !! html/parsoid
      NULL
      array (
      )
      
      !! end !! test Parser hook: basic input !! wikitext input !! html/php
      'input'
      array (
      )
      
      !! html/parsoid
      'input'
      array (
      )
      !! end ## Don't expect parsoid to rt this form. !! test Parser hook: case insensitive !! options parsoid=wt2html,html2html !! wikitext input !! html/php
      'input'
      array (
      )
      
      !! html/parsoid
      'input'
      array (
      )
      
      !! end ## Don't expect parsoid to rt this form. !! test Parser hook: case insensitive, redux !! options parsoid=wt2html,html2html !! wikitext input !! html/php
      'input'
      array (
      )
      
      !! html/parsoid
      'input'
      array (
      )
      
      !! end !! test Parser hook: nested tags !! options parsoid=wt2html !! wikitext !! html/php
      ''
      array (
      )
      

      </tag>

      !! html/parsoid
      ''
      array (
      )
      

      </tag>

      !! end !! test Parser hook: basic arguments !! wikitext !! html/php
      ''
      array (
        'width' => '200',
        'height' => '100',
        'depth' => '50',
        'square' => '',
      )
      
      !! html/parsoid
      ''
      array (
        'width' => '200',
        'height' => '100',
        'depth' => '50',
        'square' => '',
      )
      
      !! end ## Don't expect parsoid to rt this form. !! test Parser hook: basic arguments, variations !! options parsoid=wt2html,html2html !! wikitext !! html/php
      ''
      array (
        'width' => '200',
        'height' => '100',
        'depth' => '50',
        'square' => '',
      )
      
      !! html/parsoid
      ''
      array (
        'width' => '200',
        'height' => '100',
        'depth' => '50',
        'square' => '',
      )
      
      !! end !! test Parser hook: argument containing a forward slash (T7344) !! wikitext !! html/php
      ''
      array (
        'filename' => '/tmp/bla',
      )
      
      !! html/parsoid
      ''
      array (
        'filename' => '/tmp/bla',
      )
      
      !! end ## Don't expect parsoid to rt this form. !! test Parser hook: empty input using terminated empty elements (T4374) !! options parsoid=wt2html,html2html !! wikitext text !! html/php
      NULL
      array (
        'foo' => 'bar',
      )
      

      text

      !! html/parsoid
      NULL
      array (
        'foo' => 'bar',
      )
      

      text

      !! end ##
      should be output literally since there is no matching tag that begins it ## Don't expect parsoid to rt this form. !! test Parser hook: basic arguments using terminated empty elements (T4374) !! options parsoid=wt2html !! wikitext other stuff !! html/php
      NULL
      array (
        'width' => '200',
        'height' => '100',
        'depth' => '50',
        'square' => '',
      )
      

      other stuff </tag>

      !! html/parsoid
      NULL
      array (
        'width' => '200',
        'height' => '100',
        'depth' => '50',
        'square' => '',
      )
      

      other stuff </tag>

      !! end ## Don't expect parsoid to rt this form. !! test Parser hook: Don't allow unclosed extension tags !! options parsoid=wt2html !! wikitext test 123 this is a '''test''' !! html/php

      test <tag>123

      this is a test

      !! html/parsoid

      test <tag>123

      this is a test

      !! end !! test Parser hook: horizontal rule inside extension tag that outputs
      !! wikitext
      
      Hello
      
      Goodbye
      !! html/php
      '
      Hello
      
      Goodbye ' array ( )
      !! end ### ### (see tests/parser/ParserTestParserHook.php for the extension) ### !! test Parser hook: static parser hook not inside a comment !! wikitext hello, world !! html/php


      hello, world

      !! html/parsoid

      hello, world

      !! end !! test Parser hook: static parser hook inside a comment !! wikitext !! html/php


      !! html/parsoid

      !! end # Nested template calls; this case was broken by Parser.php rev 1.506, # since reverted. !! article Template:One-parameter !! text (My parameter is: {{{1}}}) !! endarticle !! article Template:Map-one-parameter !! text {{{{{1}}}|{{{2}}}}} !! endarticle !! test Nested template calls !! wikitext {{Map-one-parameter|One-parameter|param}} !! html

      (My parameter is: param)

      !! end ### ### Sanitizer ### !! test Sanitizer: Closing of open tags !! wikitext
      !! html/php

      !! html/parsoid

      !! end # Legacy parser adds an extra newline (seen as a space) which Parsoid does not !! test Sanitizer: Closing of open but not closed tags !! wikitext foo !! html/php

      foo

      !! html/parsoid

      foo

      !! end !! test Sanitizer: Closing of closed but not open tags !! options parsoid=wt2html !! wikitext
      !! html

      !! end !! test Sanitizer: Closing of closed but not open table tags !! options parsoid=wt2html !! wikitext Table not started
      !! html

      Table not started

      !! end !! test Sanitizer: Escaping of spaces, multibyte characters, colons & other stuff in id="" !! options title=[[Main Page]] !! config wgFragmentMode=[ "html5", "legacy" ] !! wikitext byte[[#æ: v|backlink]] !! html/php

      bytebacklink

      !! html/parsoid

      bytebacklink

      !! end !! test Sanitizer: Escaping of spaces, multibyte characters, colons & other stuff in id="" (legacy) !! config wgFragmentMode=[ "legacy" ] !! wikitext byte[[#æ: v|backlink]] !! html/php

      bytebacklink

      !! end # In HTML5, the restrictions are that id must contain at least one character, # and must not contain any space characters. !! test Sanitizer: Validating the contents of the id attribute (T6515) !! options disabled !! wikitext

      !! html Something ... !! end # In HTML5, id must be unique amongst all the ids in the element's home subtree. !! test Sanitizer: Validating id attribute uniqueness (T6515, T8301) !! options disabled !! wikitext

      !! html Something need to be done. foo-2 ? !! end !! test Sanitizer: Validating that and work, but only for Microdata !! wikitext
      !! html

      <meta http-equiv="refresh" content="5"> <link rel="stylesheet" href="http://example.org">

      !! end !! test Sanitizer: Strip comments from CSS attributes !! options parsoid=wt2html,wt2wt !! wikitext 2013 !! html/php

      2013

      !! html/parsoid

      2013

      !! end !! test Sanitizer: Avoid unnecessary percent encoded characters in interwiki links !! wikitext [[meatball:Soft"Security]] !! html/php

      meatball:Soft"Security

      !! html/parsoid

      meatball:Soft"Security

      !! end !! test Sanitizer: angle brackets are invalid, even in interwiki links (T182338) !! wikitext [[meatball:FooBar]] [[meatball:Foo<bar]] [[meatball:Foo>bar]] !! html/php

      [[meatball:Foo<Bar]] [[meatball:Foo>Bar]] [[meatball:Foo<bar]] [[meatball:Foo>bar]]

      !! html/parsoid

      [[meatball:Foo<Bar]] [[meatball:Foo>Bar]] [[meatball:Foo<bar]] [[meatball:Foo>bar]]

      !! end !! test Self closed html pairs (T7487) !! wikitext
      Centered text
      In div text
      !! html
      Centered text
      In div text
      !! end !! test Punctuation: nbsp before exclamation !! wikitext C'est grave ! !! html/php

      C'est grave !

      !! html/parsoid

      C'est grave !

      !! end !! test Punctuation: CSS !important (T13874) !! wikitext
      important
      !! html
      important
      !! end !! test Punctuation: CSS ! important (T13874; with space after) !! wikitext
      important
      !! html
      important
      !! end !! test HTML bullet list, closed tags (T7497) !! wikitext
      • One
      • Two
      !! html/php
      • One
      • Two
      !! html/parsoid
      • One
      • Two
      !! end !! test HTML bullet list, unclosed tags (T7497) !! wikitext
      • One
      • Two
      !! html/php
      • One
      • Two
      !! html/parsoid
      • One
      • Two
      !! end !! test HTML ordered list, closed tags (T7497) !! wikitext
      1. One
      2. Two
      !! html/php
      1. One
      2. Two
      !! html/parsoid
      1. One
      2. Two
      !! end !! test HTML ordered list, unclosed tags (T7497) !! options !! wikitext
      1. One
      2. Two
      !! html/php
      1. One
      2. Two
      !! html/parsoid
      1. One
      2. Two
      !! end !! test HTML nested bullet list, closed tags (T7497) !! wikitext
      • One
      • Two:
        • Sub-one
        • Sub-two
      !! html/php
      • One
      • Two:
        • Sub-one
        • Sub-two
      !! html/parsoid
      • One
      • Two:
        • Sub-one
        • Sub-two
      !! end !! test HTML nested bullet list, open tags (T7497) !! wikitext
      • One
      • Two:
        • Sub-one
        • Sub-two
      !! html
      • One
      • Two:
        • Sub-one
        • Sub-two
      !! end !! test HTML nested ordered list, closed tags (T7497) !! wikitext
      1. One
      2. Two:
        1. Sub-one
        2. Sub-two
      !! html
      1. One
      2. Two:
        1. Sub-one
        2. Sub-two
      !! end !! test HTML nested ordered list, open tags (T7497) !! wikitext
      1. One
      2. Two:
        1. Sub-one
        2. Sub-two
      !! html/php
      1. One
      2. Two:
        1. Sub-one
        2. Sub-two
      !! html/parsoid
      1. One
      2. Two:
        1. Sub-one
        2. Sub-two
      !! end !! test HTML ordered list item with parameters oddity !! wikitext
      1. One
      !! html
      1. One
      !! end # parsoid doesn't explicitly mark autonumbered links, see T55505 !!test T7918: autonumbering !! wikitext [http://first/] [http://second] [ftp://ftp] ftp://inlineftp [mailto:enclosed@mail.tld With target] [mailto:enclosed@mail.tld] mailto:inline@mail.tld !! html/php

      [1] [2] [3]

      ftp://inlineftp

      With target

      [4]

      mailto:inline@mail.tld

      !! html/parsoid

      ftp://inlineftp

      With target

      mailto:inline@mail.tld

      !! end # # Security and HTML correctness # From Nick Jenkins' fuzz testing # !! test Fuzz testing: Parser13 !! wikitext {| | http://a| !! html
      !! end # Note that Parsoid output differs from the PHP parser here: the PHP # parser breaks the URL for the magic word, while in Parsoid the URL # production takes precedence. !! test Fuzz testing: Parser14 !! wikitext ==onmouseover=== http://__TOC__ !! html/php

      onmouseover=[edit]

      http://

      !! html/parsoid

      onmouseover=

      http://__TOC__

      !! end !! test Fuzz testing: Parser14-table !! options parsoid=wt2html,html2html !! wikitext ==a== {| STYLE=__TOC__ !! html/php

      a[edit]

      !! html/parsoid

      a

      !! end # Known to produce bogus xml (extra ) # Don't add the html/php section since it generates broken HTML !! test Fuzz testing: Parser16 !! wikitext {| !https://|||||| !! html
      https://
      !! end !! test Fuzz testing: Parser21 !! wikitext {| !irc://{{ftp://a" onmouseover="alert('hello world');" | !! html
      irc://{{ftp://a" onmouseover="alert('hello world');"
      !! end !! test Fuzz testing: Parser22 !! wikitext http://===r:::https://b {| !! html/php

      http://===r:::https://b

      !! html/parsoid

      http://===r:::https://b

      !! end # The above 'Parser24' fuzz test exposed a tokenizer bug (T221384); # this is a minimized version of the above test to catch regressions. !! test Fuzz testing: Parser24 (minimized) !! options parsoid=wt2html !! wikitext {{}} !! html/php

      {{}}

      !! html/parsoid

      {{}}

      !! end ## Remex doesn't account for fostered content. ## Known to produce bad XML for now !! test Fuzz testing: Parser24 !! options parsoid=wt2html !! wikitext {| {{{| }}}} >
      MOVE YOUR MOUSE CURSOR OVER THIS TEXT | !! html/php {{{| }}}} >
      MOVE YOUR MOUSE CURSOR OVER THIS TEXT
      !! html/parsoid

      {{{| }}}} >
      MOVE YOUR MOUSE CURSOR OVER THIS TEXT

      !! end # Note: the current result listed for this is not what the original one was, # but the original bug was JavaScript injection, which is fixed in any case. # It's not clear that the original result listed was any more correct than the # current one. Original result: #

      {{{| #

      #
    • # }}}blah" onmouseover="alert('hello world');" align="left"MOVE MOUSE CURSOR OVER HERE !!test Fuzz testing: Parser25 (T8055) !! wikitext {{{ |
    • }}}blah" onmouseover="alert('hello world');" align="left"'''MOVE MOUSE CURSOR OVER HERE !! html/php

      <LI CLASS=blah" onmouseover="alert('hello world');" align="left"MOVE MOUSE CURSOR OVER HERE

      !! html/parsoid

      <LI CLASS=blah" onmouseover="alert('hello world');" align="left"MOVE MOUSE CURSOR OVER HERE

      !! end !!test Fuzz testing: URL adjacent extension (with space, clean) !! wikitext http://example.com junk !! html/php

      http://example.com junk

      !! html/parsoid

      http://example.com junk

      !! end !!test Fuzz testing: URL adjacent extension (no space, dirty; nowiki) !! wikitext http://example.comjunk !! html/php

      http://example.comjunk

      !! html/parsoid

      http://example.comjunk

      !! end !! test Fuzz testing: URL adjacent extension (no space, dirty; pre) !! wikitext http://example.com
      junk
      !! html/php

      http://example.com

      junk
      !! html/parsoid

      http://example.com

      junk
      !! end # Parsoid will emit the newline literally in wt2wt; see next test case. !! test Fuzz testing: encoded newline in generated HTML replacements (T8577) !! options parsoid=wt2html !! wikitext
      
      !! html/php
      
      
      !! html/parsoid
      
      
      !! end
      
      !! test
      Fuzz testing: encoded newline in generated HTML replacements, html2wt (T8577)
      !! options
      parsoid=html2wt
      !! html/parsoid
      
      
      !! wikitext
      
      
      !! html/php
      
      
      !! end
      
      !! test
      Templates in extension attributes are not expanded
      !! wikitext
      
      
      !! html/php
      
      
      !! html/parsoid
      
      
      !! end
      
      !! test
      Parsing optional HTML elements (T8171)
      !! options
      !! wikitext
      
      Some tabular data More tabular data ... And yet som tabular data
      !! html
      Some tabular data More tabular data ... And yet som tabular data
      !! end !! test Correct handling of , (T8171) !! options !! wikitext
      Some tabular data More tabular data ... And yet som tabular data
      !! html
      Some tabular data More tabular data ... And yet som tabular data
      !! end !! test Parsing crashing regression (fr:JavaScript) !! wikitext !! html

      </body></x>

      !! end !! test Inline wiki vs wiki block nesting !! wikitext '''Bold paragraph New wiki paragraph !! html

      Bold paragraph

      New wiki paragraph

      !! end # FIXME: The current php output is documented # and desired output is the parsoid target. !! test Inline HTML vs wiki block nesting !! wikitext Bold paragraph New wiki paragraph !! html/php

      Bold paragraph

      New wiki paragraph

      !! html/parsoid

      Bold paragraph

      New wiki paragraph

      !! end # Original result was this: #

      boldboldbolditalics #

      # While that might be marginally more intuitive, maybe, the six-apostrophe # construct is clearly pathological and the result stated here (which is what # the parser actually does) is about as reasonable as anything. !!test Mixing markup for italics and bold !! options !! wikitext '''bold''''''bold''bolditalics''''' !! html

      'bold'boldbolditalics

      !! end !! article Xyzzyx !! text Article for special page transclusion test !! endarticle !! test Special page transclusion !! wikitext {{Special:Prefixindex/Xyzzyx}} !! html/php !! html/parsoid

      Special:PrefixIndex/Xyzzyx

      !! end !! test Special page transclusion twice (T7021) !! wikitext {{Special:Prefixindex/Xyzzyx}} {{Special:Prefixindex/Xyzzyx}} !! html/php !! html/parsoid

      Special:PrefixIndex/Xyzzyx Special:PrefixIndex/Xyzzyx

      !! end !! test Transclusion of default MediaWiki message !! wikitext {{MediaWiki:Mainpage}} !! html/php

      Main Page

      !! html/parsoid+integrated

      Main Page

      !! end !! test Transclusion of nonexistent MediaWiki message !! wikitext {{MediaWiki:Mainpagexxx}} !! html/php

      MediaWiki:Mainpagexxx

      !! html/parsoid

      MediaWiki:Mainpagexxx

      !! end !! test Transclusion of MediaWiki message with underscore !! wikitext {{MediaWiki:history_short}} !! html/php

      History

      !! html/parsoid+integrated

      History

      !! end !! test Transclusion of MediaWiki message with space !! wikitext {{MediaWiki:history short}} !! html/php

      History

      !! html/parsoid+integrated

      History

      !! end !! test Invalid header with following text !! wikitext = x = y !! html

      = x = y

      !! end !! test Section extraction test (section 0) !! options section=0 !! wikitext start ==a== ===aa=== ====aaa==== ==b== ===ba=== ===bb=== ====bba==== ===bc=== ==c== ===ca=== !! html/php start !! end !! test Section extraction test (section 1) !! options section=1 !! wikitext start ==a== ===aa=== ====aaa==== ==b== ===ba=== ===bb=== ====bba==== ===bc=== ==c== ===ca=== !! html/php ==a== ===aa=== ====aaa==== !! end !! test Section extraction test (section 2) !! options section=2 !! wikitext start ==a== ===aa=== ====aaa==== ==b== ===ba=== ===bb=== ====bba==== ===bc=== ==c== ===ca=== !! html/php ===aa=== ====aaa==== !! end !! test Section extraction test (section 3) !! options section=3 !! wikitext start ==a== ===aa=== ====aaa==== ==b== ===ba=== ===bb=== ====bba==== ===bc=== ==c== ===ca=== !! html/php ====aaa==== !! end !! test Section extraction test (section 4) !! options section=4 !! wikitext start ==a== ===aa=== ====aaa==== ==b== ===ba=== ===bb=== ====bba==== ===bc=== ==c== ===ca=== !! html/php ==b== ===ba=== ===bb=== ====bba==== ===bc=== !! end !! test Section extraction test (section 5) !! options section=5 !! wikitext start ==a== ===aa=== ====aaa==== ==b== ===ba=== ===bb=== ====bba==== ===bc=== ==c== ===ca=== !! html/php ===ba=== !! end !! test Section extraction test (section 6) !! options section=6 !! wikitext start ==a== ===aa=== ====aaa==== ==b== ===ba=== ===bb=== ====bba==== ===bc=== ==c== ===ca=== !! html/php ===bb=== ====bba==== !! end !! test Section extraction test (section 7) !! options section=7 !! wikitext start ==a== ===aa=== ====aaa==== ==b== ===ba=== ===bb=== ====bba==== ===bc=== ==c== ===ca=== !! html/php ====bba==== !! end !! test Section extraction test (section 8) !! options section=8 !! wikitext start ==a== ===aa=== ====aaa==== ==b== ===ba=== ===bb=== ====bba==== ===bc=== ==c== ===ca=== !! html/php ===bc=== !! end !! test Section extraction test (section 9) !! options section=9 !! wikitext start ==a== ===aa=== ====aaa==== ==b== ===ba=== ===bb=== ====bba==== ===bc=== ==c== ===ca=== !! html/php ==c== ===ca=== !! end !! test Section extraction test (section 10) !! options section=10 !! wikitext start ==a== ===aa=== ====aaa==== ==b== ===ba=== ===bb=== ====bba==== ===bc=== ==c== ===ca=== !! html/php ===ca=== !! end !! test Section extraction test (nonexistent section 11) !! options section=11 !! wikitext start ==a== ===aa=== ====aaa==== ==b== ===ba=== ===bb=== ====bba==== ===bc=== ==c== ===ca=== !! html/php !! end !! test Section extraction test with bogus heading (section 1) !! options section=1 !! wikitext ==a== ==bogus== not a legal section ==b== !! html/php ==a== ==bogus== not a legal section !! end !! test Section extraction test with bogus heading (section 2) !! options section=2 !! wikitext ==a== ==bogus== not a legal section ==b== !! html/php ==b== !! end !! test Section extraction test with comment after heading (section 1) !! options section=1 !! wikitext ==a== ==b== ==c== !! html/php ==a== !! end !! test Section extraction test with comment after heading (section 2) !! options section=2 !! wikitext ==a== ==b== ==c== !! html/php ==b== !! end !! test Section extraction test with bogus heading (section 1) !! options section=1 !! wikitext ==a== ==bogus== not a legal section ==b== !! html/php ==a== ==bogus== not a legal section !! end !! test Section extraction test with bogus heading (section 2) !! options section=2 !! wikitext ==a== ==bogus== not a legal section ==b== !! html/php ==b== !! end # Formerly testing for T4587, now resolved by the use of unmarked sections # instead of respecting commented sections !! test Section extraction prefixed by comment (section 1) !! options section=1 !! wikitext ==sec1== ==sec2== !! html/php ==sec2== !!end !! test Section extraction prefixed by comment (section 2) !! options section=2 !! wikitext ==sec1== ==sec2== !! html/php !! end # Formerly testing for T4607, now resolved by the use of unmarked sections # instead of respecting HTML-style headings !! test Section extraction, mixed wiki and html (section 1) !! options section=1 !! wikitext

      unmarked

      unmarked ==1== one ==2== two !! html/php ==1== one !! end !! test Section extraction, mixed wiki and html (section 2) !! options section=2 !! wikitext

      unmarked

      unmarked ==1== one ==2== two !! html/php ==2== two !! end # Formerly testing for T5342 !! test Section extraction, heading surrounded by !! options section=1 !! wikitext ==unmarked== ==marked== !! html/php ==marked== !!end # Test behavior of T21910 !! test Sectiion with all-equals !! options section=2 !! wikitext === The line above must have a trailing space === But just in case it doesn't... !! html/php === But just in case it doesn't... !! end !! test Section replacement test (section 0) !! options replace=0,"xxx" !! wikitext start ==a== ===aa=== ====aaa==== ==b== ===ba=== ===bb=== ====bba==== ===bc=== ==c== ===ca=== !! html/php xxx ==a== ===aa=== ====aaa==== ==b== ===ba=== ===bb=== ====bba==== ===bc=== ==c== ===ca=== !! end !! test Section replacement test (section 1) !! options replace=1,"xxx" !! wikitext start ==a== ===aa=== ====aaa==== ==b== ===ba=== ===bb=== ====bba==== ===bc=== ==c== ===ca=== !! html/php start xxx ==b== ===ba=== ===bb=== ====bba==== ===bc=== ==c== ===ca=== !! end !! test Section replacement test (section 2) !! options replace=2,"xxx" !! wikitext start ==a== ===aa=== ====aaa==== ==b== ===ba=== ===bb=== ====bba==== ===bc=== ==c== ===ca=== !! html/php start ==a== xxx ==b== ===ba=== ===bb=== ====bba==== ===bc=== ==c== ===ca=== !! end !! test Section replacement test (section 3) !! options replace=3,"xxx" !! wikitext start ==a== ===aa=== ====aaa==== ==b== ===ba=== ===bb=== ====bba==== ===bc=== ==c== ===ca=== !! html/php start ==a== ===aa=== xxx ==b== ===ba=== ===bb=== ====bba==== ===bc=== ==c== ===ca=== !! end !! test Section replacement test (section 4) !! options replace=4,"xxx" !! wikitext start ==a== ===aa=== ====aaa==== ==b== ===ba=== ===bb=== ====bba==== ===bc=== ==c== ===ca=== !! html/php start ==a== ===aa=== ====aaa==== xxx ==c== ===ca=== !! end !! test Section replacement test (section 5) !! options replace=5,"xxx" !! wikitext start ==a== ===aa=== ====aaa==== ==b== ===ba=== ===bb=== ====bba==== ===bc=== ==c== ===ca=== !! html/php start ==a== ===aa=== ====aaa==== ==b== xxx ===bb=== ====bba==== ===bc=== ==c== ===ca=== !! end !! test Section replacement test (section 6) !! options replace=6,"xxx" !! wikitext start ==a== ===aa=== ====aaa==== ==b== ===ba=== ===bb=== ====bba==== ===bc=== ==c== ===ca=== !! html/php start ==a== ===aa=== ====aaa==== ==b== ===ba=== xxx ===bc=== ==c== ===ca=== !! end !! test Section replacement test (section 7) !! options replace=7,"xxx" !! wikitext start ==a== ===aa=== ====aaa==== ==b== ===ba=== ===bb=== ====bba==== ===bc=== ==c== ===ca=== !! html/php start ==a== ===aa=== ====aaa==== ==b== ===ba=== ===bb=== xxx ===bc=== ==c== ===ca=== !! end !! test Section replacement test (section 8) !! options replace=8,"xxx" !! wikitext start ==a== ===aa=== ====aaa==== ==b== ===ba=== ===bb=== ====bba==== ===bc=== ==c== ===ca=== !! html/php start ==a== ===aa=== ====aaa==== ==b== ===ba=== ===bb=== ====bba==== xxx ==c== ===ca=== !!end !! test Section replacement test (section 9) !! options replace=9,"xxx" !! wikitext start ==a== ===aa=== ====aaa==== ==b== ===ba=== ===bb=== ====bba==== ===bc=== ==c== ===ca=== !! html/php start ==a== ===aa=== ====aaa==== ==b== ===ba=== ===bb=== ====bba==== ===bc=== xxx !! end !! test Section replacement test (section 10) !! options replace=10,"xxx" !! wikitext start ==a== ===aa=== ====aaa==== ==b== ===ba=== ===bb=== ====bba==== ===bc=== ==c== ===ca=== !! html/php start ==a== ===aa=== ====aaa==== ==b== ===ba=== ===bb=== ====bba==== ===bc=== ==c== xxx !! end !! test Section replacement test with initial whitespace (T15728) !! options replace=2,"xxx" !! wikitext Preformatted initial line ==a== ===a=== !! html/php Preformatted initial line ==a== xxx !! end !! test Section extraction, heading followed by pre with 20 spaces (T8398) !! options section=1 !! wikitext ==a== a !! html/php ==a== a !! end !! test Section extraction, heading followed by pre with 19 spaces (T8398 check) !! options section=1 !! wikitext ==a== a !! html/php ==a== a !! end !! test Section extraction,
       around bogus header (T12309)
      !! options
      section=2
      !! wikitext
      == Section One ==
      
      =======
      
      == Section Two == stuff !! html/php == Section Two == stuff !! end !! test Section replacement,
       around bogus header (T12309)
      !! options
      replace=2,"xxx"
      !! wikitext
      == Section One ==
      
      =======
      
      == Section Two == stuff !! html/php == Section One ==
      =======
      
      xxx !! end !! test Handling of in URLs !! wikitext *irc:// a !! html/php !! html/parsoid !! end !! test Handling of %0A in URLs !! wikitext *irc://%0Aa !! html/php !! html/parsoid !! end # The PHP parser strips the empty tags out for giggles; parsoid doesn't. !! test 5 quotes, code coverage +1 line !! options parsoid=wt2html !! wikitext ''''' !! html/php !! html/parsoid

      !! end # same html as previous, but wikitext adjusted to match parsoid html2wt # note that wt2html will put the before the !! test 5 quotes, code coverage +1 line (1) !! options parsoid=html2wt !! html/parsoid

      !! wikitext !! end # same as previous, just swapping the and !! test 5 quotes, code coverage +1 line (2) !! options parsoid=html2wt !! html/parsoid

      !! wikitext !! end !! test Special:Search page linking. !! wikitext {{Special:search}} !! html/php

      Special:Search

      !! html/parsoid+integrated

      Special:Search

      !! html/parsoid+standalone

      Special:Search

      !! end !! test {{!}} is a magic word !! wikitext {{!}} is a magic word there and {{!}} is still a magic word here | is not a magic word here but {{!}} is still a magic word here !! html/php

      | is a magic word there and | is still a magic word here | is not a magic word here but | is still a magic word here

      !! html/parsoid

      | is a magic word there and | is still a magic word here | is not a magic word here but | is still a magic word here

      !! end !! test Single {{!}} in table cell !! wikitext {| | colspan="1" |foo {{!}} bar |} !! html/php
      foo | bar
      !! html/parsoid
      foo | bar
      !! end !! article Template:T290526 !! text Main Page{{!}}Something else !! endarticle !! test Using {{!}} in wikilinks (T290526) !! wikitext [[Main Page{{!}}Something else]] [[{{T290526}}]] !! html

      Something else

      Something else

      !! end !! test Using {{!}} in template arguments (T290526) !! wikitext {{1x|Main Page{{!}}Something else}} {{1x|{{T290526}}}} !! html/php

      Main Page|Something else

      Main Page|Something else

      !! html/parsoid

      Main Page|Something else

      Main Page|Something else

      !! end # wt2wt,html2wt,html2html modes will add around the {{ }} in # the last line !! test Using {{!}} in template arguments, part 2 (T290526) !! options parsoid=wt2html !! wikitext {{ Main Page|Something else }} {{ {{T290526}} }} !! html/php

      Template:Main Page

      {{ Main Page|Something else }}

      !! html/parsoid

      Template:Main_Page

      {{ Main Page|Something else }}

      !! end !! test Say the magic word !! options title=[[Parser test]] !! wikitext *{{PAGENAME}} *{{PAGENAMEE}} *{{FULLPAGENAME}} *{{FULLPAGENAMEE}} *{{BASEPAGENAME}} *{{BASEPAGENAMEE}} *{{SUBPAGENAME}} *{{SUBPAGENAMEE}} *{{ROOTPAGENAME}} *{{ROOTPAGENAMEE}} *{{TALKPAGENAME}} *{{TALKPAGENAMEE}} *{{SUBJECTPAGENAME}} *{{SUBJECTPAGENAMEE}} *{{NAMESPACEE}} *{{NAMESPACE}} *{{NAMESPACENUMBER}} *{{TALKSPACE}} *{{TALKSPACEE}} *{{SUBJECTSPACE}} *{{SUBJECTSPACEE}} *{{Dynamic|{{NUMBEROFUSERS}}|{{NUMBEROFPAGES}}|{{CURRENTVERSION}}|{{CONTENTLANGUAGE}}|{{DIRECTIONMARK}}|{{CURRENTTIMESTAMP}}|{{NUMBEROFARTICLES}}}} !! html/php
      • Parser test
      • Parser_test
      • Parser test
      • Parser_test
      • Parser test
      • Parser_test
      • Parser test
      • Parser_test
      • Parser test
      • Parser_test
      • Talk:Parser test
      • Talk:Parser_test
      • Parser test
      • Parser_test
      • 0
      • Talk
      • Talk
      • Template:Dynamic
      !! html/parsoid
      • Parser test
      • Parser test
      • Parser test
      • Parser function implementation for pf_basepagename missing in Parsoid.
      • Parser function implementation for pf_basepagenamee missing in Parsoid.
      • Parser function implementation for pf_subpagename missing in Parsoid.
      • Parser function implementation for pf_subpagenamee missing in Parsoid.
      • Parser function implementation for pf_rootpagename missing in Parsoid.
      • Parser function implementation for pf_rootpagenamee missing in Parsoid.
      • Parser test
      • Parser function implementation for pf_talkpagenamee missing in Parsoid.
      • Parser function implementation for pf_subjectpagename missing in Parsoid.
      • Parser function implementation for pf_subjectpagenamee missing in Parsoid.
      • Main
      • Main
      • 0
      • Talk
      • Parser function implementation for pf_talkspacee missing in Parsoid.
      • Main
      • Parser function implementation for pf_subjectspacee missing in Parsoid.
      • Template:Dynamic
      !! html/parsoid+integrated
      • Parser test
      • Parser_test
      • Parser test
      • Parser_test
      • Parser test
      • Parser_test
      • Parser test
      • Parser_test
      • Parser test
      • Parser_test
      • Talk:Parser test
      • Talk:Parser_test
      • Parser test
      • Parser_test
      • 0
      • Talk
      • Talk
      • Template:Dynamic
      !! end ### Note: Above tests excludes the "{{NUMBEROFADMINS}}" magic word because it generates a MySQL error when included. !! test HTML Hex character encoding (spells the word "JavaScript") !! options parsoid=wt2html,wt2wt,html2html !! wikitext JavaScript !! html/php

      JavaScript

      !! html/parsoid

      JavaScript

      !! end !! test HTML Hex character encoding bogus encoding (T28437 regression check) !! wikitext &#xsee;&#XSEE; !! html

      &#xsee;&#XSEE;

      !! end !! test HTML Hex character encoding mixed case !! options parsoid=wt2html,wt2wt,html2html !! wikitext îî !! html/php

      îî

      !! html/parsoid

      îî

      !! end # See: https://www.w3.org/TR/html5/syntax.html#character-references # Note that U+000C (form feed) is not a valid XML character, so # it is banned even though allowed in HTML5. # Note there are also weird legacy numeric entities which are mapped # elsewhere; see T113194 !! test Illegal character references (T106578, T113194) !! options parsoid={ "modes": ["wt2html","html2html"], "normalizePhp": true } !! wikitext ; Null: � ; FF: ; CR: ; Control (low):  ; Control (high):  Ÿ ; Unsupported legacy: € ‚ ƒ – Ÿ ; Surrogate: �� ; Invalid characters: ￾ ￿ ; This is an okay astral character: 💩 ; This is an okay multi-codepoint HTML5 entity: ∾̳ ; This are valid wikitext-specific entities: &רלמ; &رلم; ; Highest valid characters: 􏿽 􏿾 􏿿 !! html
      Null
      &#00;
      FF
      &#xC;
      CR
      &#xD;
      Control (low)
      &#8;
      Control (high)
      &#x7F; &#x9F;
      Unsupported legacy
      &#128; &#130; &#131; &#150; &#159;
      Surrogate
      &#xD83D;&#xDCA9;
      Invalid characters
      &#xfffe; &#xffff;
      This is an okay astral character
      💩
      This is an okay multi-codepoint HTML5 entity
      ∾̳
      This are valid wikitext-specific entities
      ‏ ‏
      Highest valid characters
      􏿽 􏿾 􏿿
      !! end # test added in 4e717c01589378893c98e333884315c166c217b3 # __FORCETOC__ won't set show-toc if there are no sections # present to show; also test that __NEWSECTIONLINK__ results in the # proper ParserOutputFlag being set. !! test __FORCETOC__ override !! options showflags !! wikitext __NEWSECTIONLINK__ __FORCETOC__ !! metadata flags=mw-NewSection !! html/php


      !! html/parsoid !! end !! test ISBN code coverage !! wikitext ISBN 978-0-1234-56 789 !! html/php

      ISBN 978-0-1234-56 789

      !! html/parsoid

      ISBN 978-0-1234-56 789

      !! end !! test ISBN followed by 5 spaces !! wikitext ISBN !! html

      ISBN

      !! end !! test Double ISBN !! wikitext ISBN ISBN 1234567890 !! html/php

      ISBN ISBN 1234567890

      !! html/parsoid

      ISBN ISBN 1234567890

      !! end # Uppercase X and lowercase x as well !! test ISBN with an X !! wikitext ISBN 3-462-04561-X ISBN 3-462-04561-x ISBN 080442957X ISBN 080442957x ISBN 978080442957X ISBN 978080442957x !! html/php

      ISBN 3-462-04561-X ISBN 3-462-04561-x ISBN 080442957X ISBN 080442957x ISBN 978080442957X ISBN 978080442957x

      !! html/parsoid

      ISBN 3-462-04561-X ISBN 3-462-04561-x ISBN 080442957X ISBN 080442957x ISBN 978080442957X ISBN 978080442957x

      !! end !! test ISBN with empty prefix (parsoid test) !! wikitext ISBN 1234567890 !! html/php

      ISBN 1234567890

      !! html/parsoid

      ISBN 1234567890

      !! end !! test T24905: followed by ISBN followed by !! wikitext (fr) ISBN 2753300917 [http://www.example.com example.com] !! html/php

      (fr) ISBN 2753300917 example.com

      !! html/parsoid

      (fr) ISBN 2753300917 example.com

      !! end !! test Double RFC !! wikitext RFC RFC 1234 !! html/php

      RFC RFC 1234

      !! html/parsoid

      RFC RFC 1234

      !! end !! test Double RFC with a wiki link !! wikitext RFC [[RFC 1234]] !! html/php

      RFC RFC 1234

      !! html/parsoid

      RFC RFC 1234

      !! end !! test RFC code coverage !! wikitext RFC 983 987 !! html/php

      RFC 983 987

      !! html/parsoid

      RFC 983 987

      !! end !! test Another italics / bold test !! options parsoid=wt2html !! wikitext ''' ''x' !! html/*
      ' x'
      
      !! end !! test dt/dd/dl test !! wikitext :;;;:: !! html
      !! end !! test [Before] HTML without raw HTML enabled ($wgRawHtml==false) !! wikitext !! html

      <html><script>alert(1);</script></html>

      !! end !! test HTML with raw HTML ($wgRawHtml==true) !! options wgRawHtml=1 !! wikitext !! html/php

      !! html/parsoid

      !! end !! test Empty tag w/ raw HTML ($wgRawHtml==true) !! options wgRawHtml=1 !! wikitext !! html/php

      !! html/parsoid

      !! end !! article Subpage test !! text subpage !! end !! article Subpage test/L1 !! text subpage l1 !! end !! article Subpage test/L1/L2 !! text subpage l2 !! end !! test Parents of subpages, one level up !! options subpage title=[[Subpage test/L1/L2/L3]] !! wikitext [[../|L2]] !! html/php

      L2

      !! html/parsoid

      L2

      !! end !! test Parents of subpages, one level up, not named !! options subpage title=[[Subpage test/L1/L2/L3]] !! wikitext [[../]] !! html/php

      Subpage test/L1/L2

      !! html/parsoid

      Subpage test/L1/L2

      !! end !! test Parents of subpages, two levels up !! options subpage title=[[Subpage test/L1/L2/L3]] !! wikitext [[../../|L1]]2 [[../../|L1]]l !! html/php

      L12

      L1l

      !! html/parsoid

      L12

      L1l

      !! end !! test Parents of subpages, two levels up, without trailing slash or name. !! options subpage title=[[Subpage test/L1/L2/L3]] !! wikitext [[../..]] !! html

      [[../..]]

      !! end !! test Parents of subpages, two levels up, with lots of extra trailing slashes. !! options subpage title=[[Subpage test/L1/L2/L3]] !! wikitext [[../../////]] !! html/php

      Subpage test/L1

      !! html/parsoid

      Subpage test/L1

      !! end !! article Subpage test/L1/L2/L3Sibling !! text Sibling article !! endarticle !! test Transclusion of a sibling page (one level up) !! options subpage title=[[Subpage test/L1/L2/L3]] !! wikitext {{../L3Sibling}} !! html

      Sibling article

      !! end !! test Transclusion of a child page !! options subpage title=[[Subpage test/L1/L2]] !! wikitext {{/L3Sibling}} !! html

      Sibling article

      !! end # This is wt2html only in Parsoid because we add # because of {{..}} and we don't expect to fix that to # eliminate the nowikis selective for {{..}} markup. !! test Non-transclusion because of too many up levels !! options subpage title=[[Subpage test/L1/L2/L3]] parsoid=wt2html !! wikitext {{../../../../More than parent}} !! html/php

      {{../../../../More than parent}}

      !! html/parsoid

      {{../../../../More than parent}}

      !! end !! test Definition list code coverage !! options parsoid=wt2html,html2html !! wikitext ;title :def ;title :def ;title:def !! html/php
      title
      def
      title
      def
      title
      def
      !! html/parsoid
      title
      def
      title
      def
      title
      def
      !! end !! test Don't fall for the self-closing div !! wikitext
      hello world
      !! html
      hello world
      !! end !! test MSGNW magic word !! wikitext {{MSGNW:msg}} !! html/php

      [[:Template:Msg]]

      !! end !! test RAW magic word !! wikitext {{RAW:QUERTY}} !! html/php

      Template:QUERTY

      !! html/parsoid+integrated

      Template:QUERTY

      !! end # This isn't needed for XHTML conformance, but would be handy as a fallback security measure !! test Always escape literal '>' in output, not just after '<' !! wikitext ><> !! html

      ><>

      !! end !! test Template caching !! wikitext {{Test}} {{Test}} !! html

      This is a test template This is a test template

      !! end !! article MediaWiki:Fake !! text ==header== !! endarticle !! test Inclusion of !userCanEdit() content !! wikitext {{MediaWiki:Fake}} !! html

      header[edit]

      !! end !! test Out-of-order TOC heading levels !! wikitext ==2== ======6====== ===3=== =1= =====5===== ==2== !! html

      2[edit]

      6[edit]

      3[edit]

      1[edit]

      5[edit]

      2[edit]

      !! end !! test ISBN with a dummy number !! wikitext ISBN --- !! html

      ISBN ---

      !! end !! test ISBN with space-delimited number !! wikitext ISBN 92 9017 032 8 !! html/php

      ISBN 92 9017 032 8

      !! html/parsoid

      ISBN 92 9017 032 8

      !! end !! test ISBN with multiple spaces, no number !! wikitext ISBN foo !! html

      ISBN foo

      !! end !! test ISBN length !! wikitext ISBN 123456789 ISBN 1234567890 ISBN 12345678901 !! html/php

      ISBN 123456789

      ISBN 1234567890

      ISBN 12345678901

      !! html/parsoid

      ISBN 123456789

      ISBN 1234567890

      ISBN 12345678901

      !! end !! test ISBN with trailing year (T9110) !! wikitext ISBN 1-234-56789-0 - 2006 ISBN 1 234 56789 0 - 2006 !! html/php

      ISBN 1-234-56789-0 - 2006

      ISBN 1 234 56789 0 - 2006

      !! html/parsoid

      ISBN 1-234-56789-0 - 2006

      ISBN 1 234 56789 0 - 2006

      !! end !! test anchorencode !! config wgFragmentMode=[ "html5", "legacy" ] !! wikitext {{anchorencode:foo bar©#%n}} !! html/php

      foo_bar©#%n

      !! html/parsoid

      foo_bar©#%n

      !! end !! test anchorencode (legacy) !! config wgFragmentMode=[ "legacy" ] !! wikitext {{anchorencode:foo bar©#%n}} !! html/php

      foo_bar.C2.A9.23.25n

      !! end !! test anchorencode trims spaces !! config wgFragmentMode=[ "html5", "legacy" ] !! wikitext {{anchorencode: __pretty__please__}} !! html/php

      pretty_please

      !! html/parsoid

      pretty_please

      !! end !! test anchorencode deals with links !! config wgFragmentMode=[ "html5", "legacy" ] !! wikitext {{anchorencode: [[hello|world]] [[hi]]}} !! html/php

      world_hi

      !! html/parsoid

      world_hi

      !! end !! test anchorencode deals with templates !! config wgFragmentMode=[ "html5", "legacy" ] !! wikitext {{anchorencode: {{Foo}} x}} !! html/php

      FOO_x

      !! html/parsoid

      FOO_x

      !! end !! test anchorencode encodes like the TOC generator: (T20431) !! config wgFragmentMode=[ "html5", "legacy" ] !! wikitext ===_ +:.3A%3A _ &&]] x=== {{anchorencode: _ +:.3A%3A _ &&]] x}} __NOEDITSECTION__ !! html/php

      _ +:.3A%3A _ &&]] x

      +:.3A%253A_&&]]_x


      !! html/parsoid+standalone

      _ +:.3A%3A _ &&]] x

      +:.3A%253A_&&]]_x

      !! html/parsoid+integrated

      _ +:.3A%3A _ &&]] x

      +:.3A%253A_&&]]_x

      !! end !! test anchorencode encodes like the TOC generator: (T20431) (legacy) !! config wgFragmentMode=[ "legacy" ] !! wikitext ===_ +:.3A%3A&&]]=== {{anchorencode: _ +:.3A%3A&&]] }} __NOEDITSECTION__ !! html/php

      _ +:.3A%3A&&]]

      .2B:.3A.253A.26.26.5D.5D

      !! end !! test T8200: blockquotes and paragraph formatting !! wikitext
      foo
      bar baz !! html

      foo

      bar

      baz
      
      !! end !! test T10293: Use of center tag ruins paragraph formatting !! wikitext
      foo
      bar baz !! html

      foo

      bar

      baz
      
      !! end !!test Parsing of overlapping (improperly nested) inline html tags !! wikitext x !! html

      x

      !!end !! test T2529: Uncovered bullet !! wikitext *Foo {{bullet}} !! html/php
      • Foo
      • Bar
      !! html/parsoid
      • Foo
      • Bar
      !! end !! test T2529: Uncovered bullet in a deeply nested list !! wikitext *******Foo {{bullet}} !! html/php
                  • Foo
      • Bar
      !! html/parsoid
                  • Foo
      • Bar
      !! end !! test T2529: Uncovered table already at line-start !! wikitext x {{table}} y !! html/php

      x

      1 2
      3 4

      y

      !! html/parsoid

      x

      12
      34

      y

      !! end ## FIXME: Parsoid & legacy parser results differ here. ## This will be fixed in integrated mode testing and standalone ## mode testing will be disabled on this test since parser functions ## aren't properly implemented in Parsoid for standalone testing. !! test T2529: Uncovered bullet in parser function result !! wikitext *Foo{{lc:{{bullet}} }} !! html/php
      • Foo
      • bar
      !! html/parsoid
      • Foobar
      !! html/parsoid+integrated
      • Foo
      • bar
      !! end !! test T7678: Double-parsed template argument !! wikitext {{lc:{{{1}}}|hello}} !! html

      {{{1}}}

      !! end ## wt2html only, since the bare {{ will get escaped when serializing !! test T7678: Double-parsed template invocation !! options parsoid=wt2html !! wikitext {{lc:{{paramtest {{!}} param = hello }} }} !! html/php

      {{paramtest | param = hello }}

      !! html/parsoid+integrated

      {{paramtest | param = hello }}

      !! end !! test Case insensitivity of parser functions for non-ASCII characters (T10143) !! options language=cs title=[[Main Page]] !! wikitext {{PRVNÍVELKÉ:ěščř}} {{prvnívelké:ěščř}} {{PRVNÍMALÉ:ěščř}} {{prvnímalé:ěščř}} {{MALÁ:ěščř}} {{malá:ěščř}} {{VELKÁ:ěščř}} {{velká:ěščř}} !! html

      Ěščř Ěščř ěščř ěščř ěščř ěščř ĚŠČŘ ĚŠČŘ

      !! end !! test Morwen/13: Unclosed link followed by heading !! wikitext [[link ==heading== !! html

      [[link

      heading[edit]

      !! end !! test HHP2.1: Heuristics for headings in preprocessor parenthetical structures !! wikitext {{foo| =heading= !! html

      {{foo|

      heading

      !! end !! test HHP2.2: Heuristics for headings in preprocessor parenthetical structures !! wikitext {{foo| ==heading== !! html

      {{foo|

      heading[edit]

      !! end !! test Paragraphs inside divs (no extra line breaks) !! wikitext
      Line one Line two
      !! html
      Line one Line two
      !! end !! test Paragraphs inside divs (extra line break on open) !! wikitext
      Line one Line two
      !! html

      Line one

      Line two
      !! end !! test Paragraphs inside divs (extra line break on close) !! wikitext
      Line one Line two
      !! html
      Line one

      Line two

      !! end !! test Paragraphs inside divs (extra line break on open and close) !! wikitext
      Line one Line two
      !! html

      Line one

      Line two

      !! end # doBlockLevels screws up this output and Remex cleans up as much as it can. !! test Nesting tags, paragraphs on lines which begin with
      !! wikitext
      A B !! html/php

      A

      B

      !! html/parsoid

      A

      B

      !! end # T8200:
      should behave like
      with respect to line breaks !! test T8200: paragraphs inside blockquotes (no extra line breaks) !! wikitext
      Line one Line two
      !! html

      Line one Line two

      !! end !! test T8200: paragraphs inside blockquotes (extra line break on open) !! wikitext
      Line one Line two
      !! html

      Line one

      Line two

      !! end !! test T8200: paragraphs inside blockquotes (extra line break on close) !! wikitext
      Line one Line two
      !! html

      Line one

      Line two

      !! end !! test T8200: paragraphs inside blockquotes (extra line break on open and close) !! wikitext
      Line one Line two
      !! html

      Line one

      Line two

      !! end ## This is a corner case interaction between the paragraph wrapping in the ## php parser's BlockLevelPass and Remex. `doBlockLevels` has a notion of ## some tags which close paragraphs (and thus prevent wrapping on their line), ## of which "div" is one, but do p-wrapping inside them. These are referred ## to as "never suppressing". Remex, for its part, doesn't traverse into ## "div"s to p-wrap. Hence, we only get this partial wrapping. !! test Paragraphs inside blockquotes/divs (no extra line breaks) !! wikitext
      Line one Line two
      !! html
      Line one Line two
      !! end !! test Paragraphs inside blockquotes/divs (extra line break on open) !! wikitext
      Line one Line two
      !! html

      Line one

      Line two
      !! end !! test Paragraphs inside blockquotes/divs (extra line break on close) !! wikitext
      Line one Line two
      !! html
      Line one

      Line two

      !! end !! test Paragraphs inside blockquotes/divs (extra line break on open and close) !! wikitext
      Line one Line two
      !! html

      Line one

      Line two

      !! end !! test Interwiki links trounced by handleExternalLinks after early LinkHolderArray expansion !! options wgLinkHolderBatchSize=0 !! wikitext [[meatball:1]] [[meatball:2]] [[meatball:3]] !! html

      meatball:1 meatball:2 meatball:3

      !! end !! test T17196: localised external link numbers !! options language=fa !! wikitext [http://en.wikipedia.org/] !! html/php

      [۱]

      !! html/parsoid

      !! end !! test Multibyte character in padleft !! wikitext {{padleft:-Hello|7|Æ}} !! html/php

      Æ-Hello

      !! html/parsoid

      Æ-Hello

      !! end !! test Multibyte character in padright !! wikitext {{padright:Hello-|7|Æ}} !! html/php

      Hello-Æ

      !! html/parsoid

      Hello-Æ

      !! end !!test formatdate parser function !! wikitext {{#formatdate:2009-03-24}} !! html/php

      2009-03-24

      !! html/parsoid+integrated

      2009-03-24

      !! end !!test formatdate parser function, with default format !! wikitext {{#formatdate:2009-03-24|mdy}} !! html/php

      March 24, 2009

      !! html/parsoid+integrated

      March 24, 2009

      !! end !! test Spacing of numbers in formatted dates !! wikitext {{#formatdate:January 15}} !! html/php

      January 15

      !! html/parsoid+integrated

      January 15

      !! end !! test formatdate parser function, with default format and on a page of which the content language is always English and different from the wiki content language !! options language=nl title=[[MediaWiki:Common.css]] !! wikitext {{#formatdate:2009-03-24|dmy}} !! html/php

      24 March 2009

      !! html/parsoid+integrated

      24 March 2009

      !! end !! test formatdate with invalid month !! wikitext {{#formatdate:2019-22-22|dmy}} !! html/php

      2019-22-22

      !! html/parsoid+integrated

      2019-22-22

      !! end !! test formatdate: dots in month name do not match any char (T220563) !! options language=de !! wikitext {{#formatdate:jun. 3|dmy}} {{#formatdate:junx 3|dmy}} !! html/php

      3 Juni junx 3

      !! html/parsoid+integrated

      3 Juni junx 3

      !! end !! test formatdate uses correct capitalisation in French !! options language=fr !! wikitext {{#formatdate:Juin 3|dmy}} !! html/php

      3 juin

      !! html/parsoid+integrated

      3 juin

      !! end !! test formatdate uses correct capitalisation in English !! wikitext {{#formatdate:june 3|dmy}} !! html/php

      3 June

      !! html/parsoid+integrated

      3 June

      !! end # # # # # Edit comments # !! test Edit comment with link !! options comment !! wikitext I like the [[Main Page]] a lot !! html/php I like the Main Page a lot !!end !! test Edit comment with link and link text !! options comment !! wikitext I like the [[Main Page|best pages]] a lot !! html/php I like the best pages a lot !!end !! test Edit comment with link and link text with suffix !! options comment !! wikitext I like the [[Main Page|best page]]s a lot !! html/php I like the best pages a lot !!end !! test Edit comment with section link (non-local, eg in history list) !! options comment title=[[Main Page]] !! wikitext /* External links */ removed bogus entries !! html/php →‎External links: removed bogus entries !!end !! test Edit comment with section link and text before it (non-local, eg in history list) !! options comment title=[[Main Page]] !! wikitext pre-comment text /* External links */ removed bogus entries !! html/php pre-comment text →‎External links: removed bogus entries !!end !! test Edit comment with section link (local, eg in diff view) !! options comment local title=[[Main Page]] !! wikitext /* External links */ removed bogus entries !! html/php →‎External links: removed bogus entries !!end !! test Edit comment with section link that has a link in it !! options comment local title=[[Main Page]] !! wikitext /* [[A link]] */ !! html/php →‎[[A link]] !! end !! test Edit comment with section link that has a template in it !! options comment local title=[[Main Page]] !! wikitext /* {{foobar|param}} */ !! html/php →‎{{foobar|param}} !! end !! test Edit comment with subpage link (T16080) !! options comment subpage title=[[Subpage test]] !! wikitext Poked at a [[/subpage]] here... !! html/php Poked at a /subpage here... !!end !! test Edit comment with subpage link and link text (T16080) !! options comment subpage title=[[Subpage test]] !! wikitext Poked at a [[/subpage|neat little page]] here... !! html/php Poked at a neat little page here... !!end !! test Edit comment with bogus subpage link in non-subpage NS (T16080) !! options comment title=[[Subpage test]] !! wikitext Poked at a [[/subpage]] here... !! html/php Poked at a /subpage here... !!end !! test Edit comment with bare anchor link (local, as on diff) !! options comment local title=[[Main Page]] !! wikitext [[#section]] !! html/php #section !! end !! test Edit comment with bare anchor link (non-local, as on history) !! options comment title=[[Main Page]] !! wikitext [[#section]] !! html/php #section !! end !! test Anchor starting with underscore !! options title=[[Foo]] !! wikitext [[#_ref|One]] !! html/php

      One

      !! html/parsoid

      One

      !! end !! test Id starting with underscore !! wikitext
      !! html/*
      !! end !! test Edit comment with link with more than one pipe (T99346) !! options comment !! wikitext [[Main Page|Many|pipes]] !! html/php Many|pipes !! end !! test Complex edit comment with link with more than one pipe (T99346) !! options comment !! wikitext Created page with "[[Category:Requests for permissions/Bot|{{subst:#titleparts:{{subst:PAGENAME}}|1|3}}]] === [[User:MineoBot|]] 8=== {{Request for permissions/links|Mineo..." !! html/php Created page with "<noinclude>{{subst:#titleparts:{{subst:PAGENAME}}|1|3}}</noinclude> === User:MineoBot 8=== {{Request for permissions/links|Mineo..." !! end !! test Space normalisation on autocomment (T24784) !! options comment title=[[Main Page]] !! wikitext /* __hello__world__ */ !! html/php →‎__hello__world__ !! end !! test percent-encoding and + signs in comments (T28410) !! options comment !! wikitext [[ABC%33D% ++]] [[ABC%33D% ++|+%20]] !! html/php ABC3D% ++ +%20 !! end !! test Verify that displaytitle works (T24501) no displaytitle !! options showtitle !! config wgAllowDisplayTitle=true wgRestrictDisplayTitle=false !! wikitext this is not the title !! metadata Parser test !! html

      this is not the title

      !! end !! test Verify that displaytitle works (T24501) RestrictDisplayTitle=false !! options showtitle title=[[Screen]] !! config wgAllowDisplayTitle=true wgRestrictDisplayTitle=false !! wikitext this is not the title {{DISPLAYTITLE:whatever}} !! metadata whatever !! html

      this is not the title

      !! end !! test Verify that displaytitle works (T24501) RestrictDisplayTitle=true mismatch !! options showtitle title=[[Screen]] !! config wgAllowDisplayTitle=true wgRestrictDisplayTitle=true !! wikitext this is not the title {{DISPLAYTITLE:whatever}} !! metadata Screen !! html

      this is not the title

      !! end !! test Verify that displaytitle works (T24501) RestrictDisplayTitle=true matching !! options showtitle title=[[Screen]] !! config wgAllowDisplayTitle=true wgRestrictDisplayTitle=true !! wikitext this is not the title {{DISPLAYTITLE:screen}} !! metadata screen !! html

      this is not the title

      !! end !! test Verify that displaytitle works (T24501) AllowDisplayTitle=false !! options showtitle title=[[Screen]] !! config wgAllowDisplayTitle=false !! wikitext this is not the title {{DISPLAYTITLE:screen}} !! metadata Screen !! html/php

      this is not the title Template:DISPLAYTITLE:screen

      !! end !! test Verify that displaytitle works (T24501) AllowDisplayTitle=false no DISPLAYTITLE !! options showtitle title=[[Screen]] !! config wgAllowDisplayTitle=false !! wikitext this is not the title !! metadata Screen !! html

      this is not the title

      !! end !! test Verify that displaytitle handles inline CSS styles (T28547) - rejected value !! options showtitle title=[[Screen]] !! config wgAllowDisplayTitle=true wgRestrictDisplayTitle=true !! wikitext this is not the title {{DISPLAYTITLE:screen}} !! metadata screen !! html/php

      this is not the title

      !! end !! test Verify that displaytitle handles inline CSS styles (T28547) - accepted value !! options showtitle title=[[Screen]] !! config wgAllowDisplayTitle=true wgRestrictDisplayTitle=true !! wikitext this is not the title {{DISPLAYTITLE:screen}} !! metadata screen !! html/php

      this is not the title

      !! end !! test Verify that displaytitle encodes & to & (T291985) !! options showtitle title=[[Art©]] !! config wgAllowDisplayTitle=true wgRestrictDisplayTitle=true !! wikitext this is not the title {{DISPLAYTITLE:art©}} !! metadata art&copy !! html

      this is not the title

      !! end !! test Verify that displaytitle encodes & to & (T291985) !! options showtitle title=[[Art©]] !! config wgAllowDisplayTitle=true wgRestrictDisplayTitle=true !! wikitext this is not the title {{DISPLAYTITLE:art&copy}} !! metadata art&copy !! html/php

      this is not the title

      !! end !! test Verify that without displaytitle the title encodes & to & (T291985) !! options showtitle title=[[Art©]] !! config wgAllowDisplayTitle=true wgRestrictDisplayTitle=true !! wikitext this is not the title !! metadata Art&copy !! html

      this is not the title

      !! end !! test Page status indicators: Empty name is invalid !! options showindicators !! wikitext !! html/php

      Error: Page status indicators' name attribute must not be empty. Error: Page status indicators' name attribute must not be empty.

      !! end !! test Page status indicators: Weird syntaxes that are okay !! options showindicators !! wikitext !! metadata empty= name= !! html


      !! end !! test Page status indicators: Torture test !! options nohtml showindicators !! config wgParserEnableLegacyMediaDOM=false !! wikitext hello world [[Main Page]] [[File:Foobar.jpg|25px|link=]] [[File:Foobar.jpg|25px]] *foo *bar foo Preformatted
      Broken tag {| class=wikitable |cell |} Two paragraphs !! metadata 01=hello world 02=Main Page 03= 04= 05=
      • foo
      • bar
      06=foo 07=
      Preformatted
      
      08=
      Broken tag
      09=
      cell
      10=

      Two

      paragraphs

      !! html !! end !! test preload: check and !! options preload !! wikitext Hello cruelkind world. !! html/php Hello kind world. !! end !! test preload: check !! options preload !! wikitext Goodbye Hello world !! html/php Hello world !! end !! test preload: can pass tags through if we want to !! options preload !! wikitext <includeonly>Hello world</includeonly> !! html/php Hello world !! end !! test preload: check that it doesn't try to do tricks !! options preload !! wikitext * ''{{world}}'' {{subst:How are you}}{{ {{{|safesubst:}}} #if:1|2|3}} !! html/php * ''{{world}}'' {{subst:How are you}}{{ {{{|safesubst:}}} #if:1|2|3}} !! end !! test Play a bit with r67090 and T5158 !! wikitext
       
       
       
       
      !! html/php
       
       
       
       
      !! html/parsoid
       
       
       
       
      !! end !! test French spaces in wikitext !! wikitext foo ! bar ? bat 50 % is less than 75 %. Hello : this ; is « something ‹ else › again » !! html/php

      foo ! bar ? bat 50 % is less than 75 %.

      Hello : this ; is « something ‹ else › again »

      !! html/parsoid

      foo ! bar ? bat 50 % is less than 75 %.

      Hello : this ; is « something ‹ else › again »

      !! end !! test Corner case: french spaces in definition list !! options parsoid=wt2html,html2html !! wikitext ;foo : bar !! html
      foo
      bar
      !! end !! test T5158: Test for French spaces in attributes !! wikitext
      !! html/php


      !! end !! test HTML5 data attributes !! wikitext Baz

      Quuz

      !! html/php

      Baz

      Quuz

      !! html/parsoid

      Baz

      Quuz

      !! end !! test Strip reserved data attributes !! wikitext
      d
      !! html/php
      d
      !! html/parsoid
      d
      !! end !! test percent-encoding and + signs in internal links (T28410) !! config wgParserEnableLegacyMediaDOM=false !! wikitext [[User:+%]] [[Page+title%]] [[%+]] [[%+|%20]] [[%+ ]] [[%+r]] [[%]] [[+]] [[File:%+abc%39|foo|[[bar]]]] [[%33%45]] [[%33%45+]] !! html/php

      User:+% Page+title% %+ %20 %+ %+r % + bar 3E 3E+

      !! html/parsoid

      User:+% Page+title% %+ %20 %+ %+r % + bar 3E 3E+

      !! end !! test Confirm that 'apos' named character reference doesn't make it to output (not legal in HTML 4) !! wikitext Text's been normalized? !! html

      Text's been normalized?

      !! end !! test T21052 U+3000 IDEOGRAPHIC SPACE should terminate free external links !! wikitext http://www.example.org/ <-- U+3000 (vim: ^Vu3000) !! html

      http://www.example.org/ <-- U+3000 (vim: ^Vu3000)

      !! end !! test T21052 U+3000 IDEOGRAPHIC SPACE should terminate bracketed external links !! wikitext [http://www.example.org/ ideograms] !! html

      ideograms

      !! end !! test T21052 U+3000 IDEOGRAPHIC SPACE should terminate external images links !! wikitext http://www.example.org/pic.png <-- U+3000 (vim: ^Vu3000) !! html

      pic.png <-- U+3000 (vim: ^Vu3000)

      !! end !! article Mediawiki:loop1 !! text {{Identical|A}} !! endarticle !! article Mediawiki:loop2 !! text {{Identical|B}} !! endarticle !! article Template:Identical !! text {{int:loop1}} {{int:loop2}} !! endarticle !! test T33098 Template which includes system messages which includes the template !! wikitext {{Identical}} !! html/php

      Template loop detected: Template:Identical Template loop detected: Template:Identical

      !! html/parsoid+integrated

      Template loop detected: Template:Identical Template loop detected: Template:Identical

      !! end !! test T33490 Turkish: ucfirst 'blah' !! options language=tr !! wikitext {{ucfirst:blah}} !! html

      Blah

      !! end !! test T33490 Turkish: ucfirst 'ix' !! options language=tr !! wikitext {{ucfirst:ix}} !! html

      İx

      !! end !! test T33490 Turkish: lcfirst 'BLAH' !! options language=tr !! wikitext {{lcfirst:BLAH}} !! html

      bLAH

      !! end !! test T33490 Turkish: ucfırst (with a dotless i) !! options language=tr !! wikitext {{ucfırst:blah}} !! html/php

      Şablon:Ucfırst:blah

      !! html/parsoid

      Şablon:Ucfırst:blah

      !! end !! test T33490 ucfırst (with a dotless i) with English language !! options language=en !! wikitext {{ucfırst:blah}} !! html/php

      Template:Ucfırst:blah

      !! html/parsoid

      Template:Ucfırst:blah

      !! end # Note that Parsoid doesn't emit an explicit TOC. # Note also that the html2wt direction tends to emit an extra newline # between the __TOC__ magicword and the first heading unless *both* # the and the

      have a data-parsoid attribute set (even if # it's "{}"). !! test T28375: TOC with italics !! options title=[[Main Page]] !! wikitext __TOC__ ==''Lost'' episodes== !! html/php

      Lost episodes[edit]

      !! html/parsoid

      Lost episodes

      !! end !! test T28375: TOC with bold !! options title=[[Main Page]] !! wikitext __TOC__ =='''should be bold''' then normal text== !! html/php

      should be bold then normal text[edit]

      !! html/parsoid

      should be bold then normal text

      !! end !! test T35845: Headings become cursive in TOC when they contain an image !! options title=[[Main Page]] !! config wgParserEnableLegacyMediaDOM=false !! wikitext __TOC__ ==Image [[Image:foobar.jpg]]== !! html/php

      Image [edit]

      !! html/parsoid

      Image

      !! end !! test T35845 (2): Headings become bold in TOC when they contain a blockquote !! options title=[[Main Page]] !! wikitext __TOC__ ==
      Quote
      == !! html/php

      Quote

      [edit]

      !! html/parsoid

      Quote

      !! end !! test Unclosed tags in TOC !! config wgFragmentMode=[ "html5", "legacy" ] !! options title=[[Main Page]] !! wikitext __TOC__ ==Proof: 2 < 3== Hanc marginis exiguitas non caperet. QED !! html/php

      Proof: 2 < 3[edit]

      Hanc marginis exiguitas non caperet. QED

      !! html/parsoid

      Proof: 2 < 3

      Hanc marginis exiguitas non caperet. QED

      !! end !! test Multiple tags in TOC !! wikitext __TOC__ ==Foo Bar== ==Foo
      Bar
      == !! html/php

      Foo Bar[edit]

      Foo

      Bar

      [edit]

      !! html/parsoid

      Foo Bar

      Foo

      Bar

      !! end # Don't expect Parsoid to roundtrip this until the php parser comes closer to # html5 tag parsing. !! test Tags with parameters in TOC !! options parsoid=wt2html !! wikitext __TOC__ ==Hello== ==Evilbye== !! html/php

      Hello[edit]

      b">Evilbye[edit]

      !! html/parsoid

      Hello

      b">Evilbye

      !! end !! test span tags with directionality in TOC !! wikitext __TOC__ ==C++== ==זבנג!== ==The attributes on these span tags must be deleted from the TOC== ==All attributes on these span tags must be deleted from the TOC== ==Attributes after dir on these span tags must be deleted from the TOC== !! html/php

      C++[edit]

      זבנג![edit]

      The attributes on these span tags must be deleted from the TOC[edit]

      All attributes on these span tags must be deleted from the TOC[edit]

      Attributes after dir on these span tags must be deleted from the TOC[edit]

      !! html/parsoid

      C++

      זבנג!

      The attributes on these span tags must be deleted from the TOC

      All attributes on these span tags must be deleted from the TOC

      Attributes after dir on these span tags must be deleted from the TOC

      !! end !! test T74884: bdi element in ToC !! wikitext __TOC__ ==test== !! html/php

      test[edit]

      !! html/parsoid

      test

      !! end !! test T35715: s/strike element in ToC !! wikitext __TOC__ ==test test test== !! html/php

      test test test[edit]

      !! html/parsoid

      test test test

      !! end !! test T198618: style element in ToC !! options styletag=1 !! wikitext __TOC__ ==Style== !! html/php

      Style[edit]

      !! html/parsoid

      Style

      !! end !! test T198618: script element in ToC !! options wgRawHtml=1 !! wikitext __TOC__ ==Script== !! html/php

      Script[edit]

      !! html/parsoid

      Script

      !! end !! test Empty

      tag in TOC, removed by Sanitizer (T92892) !! wikitext __TOC__ ==x== !! html/php

      x[edit]

      !! html/parsoid

      x

      !! end !! article MediaWiki:T34057 !! text == {{int:ok}} == !! endarticle !! test T34057: Title needed when expanding nodes. !! options title=[[Main Page]] !! wikitext {{int:T34057}} !! html/php

      OK[edit]

      !! html/parsoid+integrated

      OK

      !! end !! test Title needed when expanding templates. !! options title=[[Main Page]] !! wikitext {{Template with pagename}} !! html/php

      This is Main Page.

      !! html/parsoid

      This is Main Page.

      !! end !! test Strip marker in urlencode !! wikitext {{urlencode:xy}} {{urlencode:xy|wiki}} {{urlencode:xy|path}} {{urlencode:x
      two
      y}} !! html/php

      xy xy xy xy

      !! end !! test Strip marker in lc !! wikitext {{lc:xy}} !! html/php

      xy

      !! html/parsoid+integrated

      xy

      !! end !! test Strip marker in uc !! wikitext {{uc:xy}} !! html/php

      XY

      !! html/parsoid+integrated

      XY

      !! end !! test Strip marker in formatNum !! wikitext {{formatnum:12}} {{formatnum:12|R}} !! html/php

      12 12

      !! html/parsoid

      12 12

      !! end !! test Check noCommafy in formatNum !! options language=be-tarask !! wikitext {{formatnum:123456.78}} {{formatnum:123456.78|NOSEP}} !! html/php

      123 456,78 123456.78

      !! html/parsoid+integrated

      123 456,78 123456.78

      !! end !! test Wrong option for formatNum (T58199) !! wikitext {{formatnum:1,234.56|Random}} {{formatnum:1,234.56|EVERYTHING}} {{formatnum:1234.56|any argument that has the string 'NOSEP'}} !! html/php

      1,234.56 1,234.56 1,234.56

      !! html/parsoid+integrated

      1,234.56 1,234.56 1,234.56

      !! end !! test Strip marker in grammar !! options language=fi !! wikitext {{grammar:elative|foobar}} !! html/php

      foobarista

      !! html/parsoid+integrated

      foobarista

      !! end !! test Strip marker in padleft !! wikitext {{padleft:|2|xy}} !! html

      xy

      !! end !! test Strip marker in padright !! wikitext {{padright:|2|xy}} !! html

      xy

      !! end !! test Strip marker in anchorencode !! wikitext {{anchorencode:xy}} !! html/php

      xy

      !! html/parsoid

      xy

      !! end !! test nowiki inside link inside heading (T20295) !! wikitext ==[[foo|xyz]]== !! html

      xyz[edit]

      !! end !! test new support for bdi element (T33817) !! wikitext

      ולדימיר לנין (ברוסית: Владимир Ленин, 24 באפריל 1870–22 בינואר 1924) הוא מנהיג פוליטי קומוניסטי רוסי.

      !! html

      ולדימיר לנין (ברוסית: Владимир Ленин, 24 באפריל 1870–22 בינואר 1924) הוא מנהיג פוליטי קומוניסטי רוסי.

      !! end !! test Ignore pipe between table row attributes !! wikitext {| |quux |- id=foo | style='color: red' |bar |} !! html
      quux
      bar
      !! end !!test Language parser function !! wikitext {{#language:ar}} !! html/php

      العربية

      !! html/parsoid+integrated

      العربية

      !! end !!test Padleft and padright (default 0-padding) !! wikitext {{padleft:xyz|5}} {{padright:xyz|5}} !! html/php

      00xyz xyz00

      !! html/parsoid

      00xyz xyz00

      !! end !!test Padleft and padright (partial fill) !! wikitext {{padleft:xyz|6|ab}} {{padright:xyz|6|ab}} !! html/php

      abaxyz xyzaba

      !! html/parsoid

      abaxyz xyzaba

      !! end !!test Padleft and padright as substr !! wikitext {{padleft:|3|abcde}} {{padright:|3|abcde}} !! html/php

      abc abc

      !! html/parsoid

      abc abc

      !! end !! test Padleft and padright with non-numerical length (T180403) !! wikitext {{padleft:abcdef|junk}} {{padright:abcdef|junk}} !! html/php

      abcdef abcdef

      !! end !!test Special parser function !! wikitext {{#special:RandomPage}} {{#special:BaDtItLe}} {{#special:Foobar}} !! html/php

      Special:Random Special:Badtitle Special:Foobar

      !! html/parsoid

      Special:Random Special:Badtitle Special:Foobar

      !! end # {{=}} will be converted to a parser function which expands to `=` # If you have it defined as a Template that expands to `=` that's ok; # and using it explicitly as {{Template:=}} (regardless of what it # expands to) is also ok and will not generate a tracking category. # T91154 # # FIXME: Parsoid doesn't yet support this magic word natively, so standalone # mode will fail this test. !! test Using {{=}} when it expands to "=" should not create a tracking category !! wikitext This uses {{=}} and {{Template:=}}. !! html/php

      This uses = and =.

      !! html/parsoid

      This uses = and =.

      !! end # Repeat the test, looking at categories. Note: none should be emitted! !! test Using {{=}} when it expands to "=" should not create a tracking category (cat) !! options cat !! wikitext This uses {{=}} and {{Template:=}}. !! html/php

      This uses = and =.

      !! end !!test T36939 - Case insensitive link parsing ([HttP://]) !! wikitext [HttP://MediaWiki.Org/] !! html/php

      [1]

      !! html/parsoid

      !! end !!test T36939 - Case insensitive link parsing ([HttP:// title]) !! wikitext [HttP://MediaWiki.Org/ MediaWiki] !! html

      MediaWiki

      !! end !!test T36939 - Case insensitive link parsing (HttP://) !! wikitext HttP://MediaWiki.Org/ !! html/php

      HttP://MediaWiki.Org/

      !! html/parsoid

      HttP://MediaWiki.Org/

      !! end !!test Disable TOC !! options notoc !! wikitext Lead ==Section 1== ==Section 2== ==Section 3== ==Section 4== ==Section 5== !! html

      Lead

      Section 1[edit]

      Section 2[edit]

      Section 3[edit]

      Section 4[edit]

      Section 5[edit]

      !! end ### ### Parsoid-specific tests ### Parsoid-PHP parser incompatibilities ### !!test 1. SOL-sensitive wikitext tokens as template-args !! options parsoid=wt2html,wt2wt !! wikitext {{1x|*a}} {{1x|#a}} {{1x|:a}} !! html/php
      • a
      1. a
      a
      !! html/parsoid
      • a
      1. a
      a
      !!end #### ----------------------------------------------------------------- #### Parsoid-specific functionality tests #### ----------------------------------------------------------------- ## Just a regression test !! test Wikilink with only closing tag in target !! options parsoid=wt2html !! wikitext [[Test|]] !! html/parsoid

      !! end #### ---------------------------------------------------------------- #### Parsoid-only testing of Parsoid's impl of LST #### Not implemented yet, see #### https://www.mediawiki.org/wiki/Parsoid/HTML_based_LST #### ---------------------------------------------------------------- ## We still need to support serializing the older format while content is stored. !! test LST Sections: Backwards compatibility !! options parsoid={ "suppressErrors": true, "modes": ["html2wt"] } !! wikitext
      !! html/parsoid

      !! end !! test LST Sections: Newfangled approach !! wikitext
      !! html/parsoid

      !! html/parsoid+integrated

      <section begin="2011-05-16" /> <section end="2014-04-10 (MW 1.23wmf22)" />

      !! end #--------- Test stripping of empty nodes in template content ---------- !! test Empty LI and TR nodes should be stripped from template content !! options parsoid=wt2html,wt2wt !! wikitext {{EmptyLITest}} {{EmptyTRTest}} !! html/parsoid
      • a
      • b
      foo
      bar
      !! end !! test Empty LI and TR nodes should not be stripped from top-level content !! wikitext *a * *b {| |- |- |foo |} !! html/parsoid
      • a
      • b
      foo
      !! end !! test Empty TR nodes should not be stripped if they have any attributes set !! wikitext {{EmptyTRWithHTMLAttrTest}} !! html/parsoid
      foo
      bar
      !! end !! test Tag-like HTML structures are passed through as text !! wikitext 1>2 xb 1f !! html

      <x y>

      <x.y>

      <x-y>

      1>2

      x<y

      a>b

      1<d e>f

      !! end !! test HTML tag with necessary entities in attributes !! wikitext foo !! html

      foo

      !! end !! test HTML tag with 'unnecessary' entity encoding in attributes !! wikitext foo !! html

      foo

      !! end !! test HTML tag with broken attribute value quoting !! options parsoid=wt2html,html2html !! wikitext Foo

      !! html/parsoid

      Foo

      !! end !! test Self-closed tag with broken attribute value quoting !! options parsoid=wt2html,html2html !! wikitext
      Foo
      !! end !! test Table with broken attribute value quoting !! options parsoid=wt2html,html2html !! wikitext {| | title="Hello world|Foo |} !! html/php
      Foo
      !! html/parsoid
      Foo
      !! end !! test Table with broken attribute value quoting on consecutive lines !! options parsoid=wt2html,html2html !! wikitext {| | title="Hello world|Foo | style="color:red|Bar |} !! html/php
      Foo Bar
      !! html/parsoid
      Foo Bar
      !! end !!test Accept empty td cell attribute !! wikitext {| | align="center" |foo|| | |} !! html
      foo
      !! end !!test Non-empty attributes in th-cells !! wikitext {| !Foo!! style="color: red" |Bar |} !! html
      Foo Bar
      !! end !!test Accept empty attributes in th-cells !! wikitext {| !|foo!!|bar |} !! html
      foo bar
      !! end !!test Empty table rows go away !! wikitext {| |Hello |there |- class="foo" |- |} !! html
      Hello there
      !! end ### ### Parsoid-centric tests for testing RTing of inter-element separators ### Edge cases not tested by existing parser tests and specific to ### Parsoid-specific serialization strategies. ### !!test RT-ed inter-element separators should be valid separators !! wikitext {| |- [[foo]] |} !! html/php
      !! html/parsoid
      !!end # Parsoid-only test of a DOM pass !!test Trailing newlines in a deep dom-subtree that ends a wikitext line should be migrated out !! wikitext {| |foo bar |} {| |foo |} !! html/parsoid
      foo

      bar

      foo
      !!end # Note that the "style" attribute is really a template parameter here. # The = would have to be {{=}} if you wanted the literal. !!test Empty TD followed by TD with tpl-generated attribute !! wikitext {| |- | |{{1x|style='color:red'}}|foo |} !! html
      foo
      !! end !!test Indented table with an empty td !! wikitext {| |- | |foo |} !! html
      foo
      !! end !! test Indented table with blank lines in between (T85627) !! wikitext {| |foo |} !! html/php
      foo


      !! html/parsoid
      foo


      !! end !!test Indented block & table !! wikitext
      foo
      {| |foo |} !! html/php
      foo
      foo
      !! html/parsoid
      foo
      foo
      !!end !! test Indent and comment before table row !! wikitext {| |- |there |} !! html/php
      there
      !! html/parsoid
      there
      !! end # PHP parser omits empty TR !!test Empty TR followed by a template-generated TR !! wikitext {| |- {{1x|foo}} |} !! html/php
      foo
      !! html/parsoid
      foo
      !!end ## PHP and parsoid output differ for this; as usual PHP omits empty ## elements, and since it strips the comments the TR is empty. !!test Empty TR followed by mixed-ws-comment line should RT correctly !! wikitext {| |- |- |} !! html/php
      !! html/parsoid
      !! end !!test Multi-line image caption generated by templates with/without trailing newlines !! wikitext [[File:Foobar.jpg|thumb|300x300px|foo\n{{1x|A}}\n{{1x|B}}\n{{1x|C}}]] [[File:Foobar.jpg|thumb|300x300px|foo\n{{1x|A}}\n{{1x|B}}\n{{1x|C}}\n\n]] !! html/parsoid
      foo\nA\nB\nC
      foo\nA\nB\nC\n\n
      !! end !! test New element inserted (without intervening newlines) after an old sol-transparent node should serialize correctly !! options parsoid=html2wt !! html/parsoid

      new para

      new heading

      !! wikitext foo new para [[Category:Foo]] = new heading = !! end ## PHP emits broken html for this, and since this is primarily ## a Parsoid serializer test, marking this Parsoid only !! test Improperly nested inline or quotes tags with whitespace in between !! options parsoid=html2wt !! html/parsoid

      x x

      !! wikitext x ''' ''x''''' !! end !!test Encapsulate protected attributes from wt !! wikitext
      foo
      {| typeof="mw:placeholder stuff" data-mw="whoo" data-parsoid="weird" data-parsoid-other="no" about="time" rel="mw:true" |ok |} !! html/parsoid
      foo
      ok
      !!end ## Currently the p-wrapper is fragile in how it adds / removes transformations. ## Having nested or stray pre tags results in the attempt to add duplicates, ## causing an assertion fail. This test tries to prevent that situation. !! test Ensure ParagraphWrapper can deal with stray closing pre tags !! options parsoid=wt2html !! wikitext plain text
      !! html/parsoid

      plain text

      !! end ## Remex doesn't account for fostered content. !! test 1. Ensure fostered text content is wrapped in element nodes !! options parsoid=wt2html !! wikitext hi
      ho
      !! html/php hi
      ho
      !! html/parsoid

      hi

      ho

      !! end ## Remex doesn't account for fostered content. !! test 2. Ensure fostered text content is wrapped in element nodes (traps regressions around fostered marker on the element getting lost) !! options parsoid=wt2html,wt2wt !! wikitext || ||
      a
      !! html/php || ||
      a
      !! html/parsoid

      || ||

      a
      !! end ## Remex doesn't account for fostered content. !! test Encapsulation properly handles null DSR information from foster box !! options parsoid=wt2html,wt2wt !! wikitext {{1x|foo
      bar
      }} !! html/parsoid

      foo

      bar
      !! end ## Remex doesn't account for fostered content. !! test 1. Encapsulate foster-parented transclusion content !! options parsoid=wt2wt,wt2html !! wikitext {{1x|foo}}
      bar
      !! html/php foo
      bar
      !! html/parsoid

      foo

      bar
      !! end !! test 2. Encapsulate foster-parented transclusion content !! options parsoid=wt2wt,wt2html !! wikitext
      {{1x|foo}}
      bar
      !! html/parsoid
      foo
      bar
      !! end !! test 3. Encapsulate foster-parented transclusion content !! options parsoid=wt2wt,wt2html !! wikitext

      {{1x|foo

      }}bar
      !! html/parsoid

      foo

      bar
      !! end !! test 4. Encapsulate foster-parented transclusion content !! options parsoid=wt2wt,wt2html !! wikitext

      {{1x|foo

      }}bar
      !! html/parsoid

      foo

      bar
      !! end ## Remex doesn't account for fostered content. !! test 5. Encapsulate foster-parented transclusion content !!options parsoid=wt2wt,wt2html !! wikitext foo}}

      {{1x|foo

      !! html/php foo

      foo

      !! html/parsoid

      foo

      foo

      !! end ## Remex doesn't account for fostered content. !! test 6. Encapsulate foster-parented transclusion content !! options parsoid=wt2wt,wt2html !! wikitext foo

      {{1x|foo

      }}

      ok

      !! html/php foo

      foo

      ok

      !! html/parsoid

      foo

      foo

      ok

      !! end !! test 7. Encapsulate foster-parented transclusion content !!options parsoid=wt2wt,wt2html !! wikitext {{1x|

      foo

      }}
      bar
      !! html/parsoid

      foo

      bar
      !! end ## Remex doesn't account for fostered content. # Note that the wt is broken on purpose: the = should be {{=}} if you # don't want it to be a template parameter key. !! test 8. Encapsulate foster-parented transclusion content !! options parsoid=wt2wt,wt2html !! wikitext {{1x|a }}{|{{1x|style='color:red'}} |- |b |} !! html/php

      a

      b
      !! html/parsoid

      a

      {{{1}}}

      b
      !! end ## Remex doesn't account for fostered content. !! test 9. Encapsulate foster-parented transclusion content !!options parsoid=wt2wt,wt2html !! wikitext {{1x|hi
      hello}} !! html/php hi

      hello

      !! html/parsoid

      hi

      hello

      !! end !! test Table in fosterable position !!options parsoid=wt2html !! wikitext {{OpenTable}}
      {| |}
      |} !! html/parsoid
      !! end # Parsoid only for T66747 # (Also core doesn't define {{#if}} in default install) !! test Properly encapsulate empty-content transclusions in fosterable positions !! wikitext {{#if:| }}
      foo
      !! html/parsoid
      !! end ## No longer captures its original intention !! test Always encapsulate foster box when template range is expanded to table !! options disabled parsoid=wt2wt !! wikitext {| hello {{OpenTable}} |} !! html/parsoid !! end !! test T115289: Unclosed table !! wikitext {{1x|}}[[Category:Two]] !! html/parsoid
      !! end !! test T115289: Don't migrate newlines out of tables with fostered content !! wikitext {{1x|[[Category:One]]}}[[Category:Two]] !! html/parsoid
      !! end !! test T73074: More fostering fun !! wikitext {{1x|}}[[Category:Two]] !! html/parsoid
      !! end !!test Support element with .data attribute !!options parsoid=html2wt !! html/parsoid !! wikitext !!end !! test T72867: Don't block XML namespace declaration !! wikitext MediaWiki !! html/php

      MediaWiki

      !! html/parsoid

      MediaWiki

      !! end # ----------------------------------------------------------------- # The following section of tests are primarily to spec requirements # around Parsoid's serialization (old, new, edited content) # # All these tests are marked Parsoid html2wt and html2html only # ---------------------------------------------------------------- !! test Ignore rel attribute in a-tags during serialization to url-links !! options parsoid=html2wt !! html/parsoid http://en.wikipedia.org/wiki/Foobar http://en.wikipedia.org/wiki/Foobar http://en.wikipedia.org/wiki/Foobar !! wikitext http://en.wikipedia.org/wiki/Foobar http://en.wikipedia.org/wiki/Foobar http://en.wikipedia.org/wiki/Foobar !! end # 'mi' is a localinterwiki prefix as well as a language !! test Serialize interwiki links pointing to the current wiki as plain wiki links (T67869) !! options parsoid=html2wt !! html/parsoid

      Foo

      !! wikitext [[Foo]] !! end !! test Parsoid should accept interwiki shortcuts !! options parsoid=html2wt !! html/parsoid

      Foo Foo Foo

      Foo Foo Foo

      Foo Foo

      !! wikitext [[:fr:Foo|Foo]] [[:fr:Foo|Foo]] [[:fr:Foo|Foo]] [[:fr:Foo|Foo]] [[:fr:Foo|Foo]] [[:fr:Foo|Foo]] [[:fr:Foo|Foo]] [[:fr:Foo|Foo]] !! end !! test Parsoid should not accept invalid interwiki shortcuts !! options parsoid=html2wt !! html/parsoid

      Foo Foo Foo

      !! wikitext [news:Foo Foo] [news:Foo Foo] [news:Foo Foo] !! end # See T93839 !! test New wikilinks should be serialized properly !! options parsoid=html2wt !! html/parsoid Foo Foo //en.wikipedia.org/wiki/Foo http://en.wikipedia.org/wiki/Foo //en.wikipedia.org/wiki/Foo bar !! wikitext [[Foo]] [[Foo]] [[:en:Foo|//en.wikipedia.org/wiki/Foo]] http://en.wikipedia.org/wiki/Foo [[:en:Foo_bar|//en.wikipedia.org/wiki/Foo bar]] !! end !! test New wiki links (href variations) !! options parsoid=html2wt !! html/parsoid Foo_bar Foo_bar Foo_bar Toxine bactérienne !! wikitext [[Foo_bar]] [[Foo_bar]] [[Foo_bar]] [[Toxine bactérienne]] !! end !! test New wiki links (content string variations) !! options parsoid=html2wt !! html/parsoid Foo_bar Foo bar ./Foo_bar !! wikitext [[Foo_bar]] [[Foo bar]] [[Foo_bar|./Foo_bar]] !! end !! test New category links (href variations) !! options parsoid=html2wt !! html/parsoid !! wikitext [[Category:Toxine bactérienne]] [[Category:Toxine bactérienne]] [[Category:Toxine bactérienne]] !! end !! test New sol transparent links don't need indent-pre nowiki protection !! options parsoid=html2wt language=de !! html/parsoid !! wikitext #WEITERLEITUNG [[Main Page]] [[Category:Good]] [[Kategorie:Great]] !! end !! test New interlanguage links (href variations) !! options parsoid=html2wt !! html/parsoid !! wikitext [[es:Toxine bactérienne]] [[es:Toxine_bactérienne]] [[es:Toxine_bactérienne]] !! end # Regression test for T219023 !! test Emit simple non-piped link where possible !! options parsoid=html2wt !! html/parsoid VisualEditor visualEditor VisualEditor link visualEditor link !! wikitext [[VisualEditor]] [[visualEditor]] [[VisualEditor link]] [[visualEditor link]] !! end !! test Lists: Serialize correctly even when list content is wrapped in p-tags (like VE does) !! options parsoid=html2wt !! html/parsoid
      • foo

      !! wikitext * foo !! end !! test Lists: Serialize correctly even when list tags has unneeded whitespace between tags !! options parsoid=html2wt !! html/parsoid
      • foo
      !! wikitext * foo !! end !! test Don't strip leading whitespace when handling indent-pre suppressing tags !! options parsoid=html2wt !! html/parsoid
      indented row

      This is very bold of you!

      indented cell (no pre-wrapping!)

      foo

      bar
      !! wikitext {| | indented row |}
      '''This is very bold of you!''' {| | indented cell (no pre-wrapping!) |}
      foo
      bar
      !! end !! test Strip leading whitespace when handling indent-pre inducing tags !! options parsoid=html2wt !! html/parsoid

      foo

      bar foo2 bar2
      foo
      bar
      foo
      !! wikitext foo bar foo2 bar2
      foo
      bar
      foo
      !! end !! test Lists: Dont insert newlines in a serialized list item. !! options parsoid=html2wt !! html/parsoid
      • a
        b
      • c
      !! wikitext * a
      b * c !! end !! test Headings: Force sol-transparent links and behavior switches to serialize before/after !! options parsoid={ "modes": ["html2wt"] } !! html/parsoid

      hello there

      hi pal

      how goes it

      it goes well

      ok

      !! wikitext == hello there == [[Category:A1]] [[Category:A2]] == hi pal == [[Category:A3]] == how goes it == == it goes well == [[Category:A4]] __TOC__ == ok == !! end !! test Headings: Don't hoist metas that come from templates !! options parsoid={ "modes": ["html2wt"] } !! html/parsoid

      foo

      !! wikitext == {{1x|foo [[Category:Foo]]}} == !! end !! test Headings: Category in ref isn't hoisted !! options parsoid={ "modes": ["html2wt"] } !! html/parsoid

      foo [1]

      1. bar
      !! wikitext == foo bar [[Category:Baz]] == !! end !! test Parsoid: Serialize positional parameters with = in them as named parameter !! options parsoid=html2wt !! html/parsoid

      foo

      foo

      foo

      !! wikitext {{1x|1=f=oo}} {{1x|1=f=oo|2=bar}} {{1x|f=oo|bar}} !! end !! test Parsoid: Serialize positional parameters with = in extlink as named parameter !! options parsoid=html2wt !! html/parsoid

      http://stuff?is=ok

      !! wikitext {{1x|1=http://stuff?is=ok}} !! end !! test Parsoid: Correctly serialize block-node children when they are a combination of text and p-nodes !! options parsoid=html2wt !! html/parsoid
      a

      b

      a

      b

      a

      b

      !! wikitext
      a b
      a b
      a b
      !! end !! test Substrings resembling wikitext in hrefs should not get nowiki escapes !! options parsoid=html2wt !! html/parsoid Foo''bar''baz !! wikitext [[Foo''bar''baz]] !! end !! test Enforce single-line context in the serializer !! options parsoid=html2wt !! html/parsoid

      testing 123

      hi there you

      foo [1]

      1. hello there
      • asd sdf
      • foo bar baz
      • foo bar baz
      hi ho
      hi ho
      ha ha ha
      !! wikitext == testing 123 == == hi {{bogus|there you}} == == foo hello there == * asd sdf * foo bar baz * foo '''bar''' baz ; hi ho : hi ho : {| | ha ha ha |} !! end # Note that core parser doesn't like newlines in wikilinks in headings. # But, Parsoid handles it just fine. We'll consider this acceptable divergence. # We can change behavior if this becomes a real problem (ex: VE users start # adding newlines in links in headings which then breaks rendering when rendered # outside of Parsoid, or breaks section editing code). Eventually Parsoid will # core parser everywhere and this inconsistency will go away. !! test Ignore single-line context for wikilinks !! options parsoid=html2wt !! html/parsoid

      bar

      !! wikitext * [[Foo| bar]] == [[Foo| bar]] == * [[Foo|bar x]] !! end !! test Selser: Ignore single-line context for wikilinks !! options parsoid={ "modes": ["selser"], "selser": "noauto", "changes": [ [ "ul > li ", "append", "
      • foo
      " ] ] } !! wikitext * [[Foo| bar]] !! wikitext/edited * [[Foo| bar]] ** foo !! end !! test Serialize new displayspace spans !! options parsoid=html2wt !! html/parsoid

      foo : bar

      foo : bar

      [1]ok

      «&nsbp;Tour Eiffel&nsbp;» Hello World!
      •  Foo
      !! wikitext foo : bar foo : bar foo : barok [http://example.com « Tour Eiffel »] Hello World! * Foo !! end #----------------------- # Tag minimization tests #----------------------- !! test 1. I/B quote minimization: wikitext-only tags should be combined !! options parsoid=html2wt !! html/parsoid

      AB

      AB

      AB

      AB

      ABCD

      AB

      AB

      AB

      !! wikitext ''AB'' '''AB''' ''A'''B''''' '''A''B''''' '''A''BC''D''' '''''AB''''' '''''AB''''' '''''AB''''' !! end !! test 2. I/B quote minimization: wikitext and html tags should not be combined !! options parsoid=html2wt !! html/parsoid

      AB

      AB

      !! wikitext ''A''B ''A'''''B''' !! end !! test 3. I/B quote minimization: templated content stops minimization !! options parsoid=html2wt !! html/parsoid

      AB

      AB !! wikitext ''A''{{1x|''B''}} ''A''{{1x|'''''B'''''}} !! end !! test 4. I/B quote minimization: new content should be mimimized with adjacent old content !! options parsoid=html2wt !! html/parsoid

      AB

      AB

      AB

      !! wikitext ''AB'' '''AB''' ''A'''B''''' !! end !! test 5a. Merge adjacent quote nodes if they've been edited !! options parsoid={ "modes": ["wt2wt", "selser"], "changes": [ ["p", "contents", "remove", ":contains('b')"] ] } !! wikitext ''a''b''c'' !! wikitext/edited ''ac'' !! end !! test 5b. Merge adjacent quote nodes if they've been edited !! options parsoid={ "modes": ["wt2wt", "selser"], "changes": [ ["#x", "remove"] ] } !! wikitext ''a''b''c'' !! wikitext/edited ''ac'' !! end !! test 1. Merge adjacent link nodes as long as at least one element is new !! options parsoid={ "modes": ["html2wt"] } !! html/parsoid Football Football Football !! wikitext [[Football]] [[Football]] [[Football|Foot]][[Football|ball]] !! end !! test 2. Merge adjacent link nodes and enable additional normalizations !! options parsoid={ "modes": ["html2wt"] } !! html/parsoid Football !! wikitext ''[[Football]]'' !! end !! test 1. Move format tags outside of WikiLink !! options parsoid={ "modes": ["html2wt"] } !! html/parsoid Football Football Football !! wikitext ''[[Football]]'' '''''[[Football]]''''' '''''[[Football]]''''' !! end !! test 2. Move format tags outside of WikiLink with mergable A tags !! options parsoid={ "modes": ["html2wt"] } !! html/parsoid Football !! wikitext '''''[[Football]]''''' !! end !! test 3. Move format tags outside of WikiLink while preserving formats already outside WikiLink !! options parsoid={ "modes": ["html2wt"] } !! html/parsoid Foo !! wikitext '''[[Foo]]''' !! end !! test 4. Do not move format tags outside of WikiLink which includes attributes color, style and class !! options parsoid={ "modes": ["html2wt"] } !! html/parsoid Foo Foo> Foo !! wikitext [[Foo|Foo]] [[Foo|Foo>]] [[Foo|Foo]] !! end !! test 5. T194083 Regression test: Manual edit test to move format tags outside wikilinks !! options parsoid={ "modes": ["selser"], "changes": [ ["a", "html", "Foo"] ] } !! wikitext [[Foo]] !! wikitext/edited ''[[Foo]]'' !! end !! test 6. Regression test: Manual edit test to ensure diff markers are not lost !! options parsoid={ "modes": ["selser"], "changes": [ ["i", "wrap", ""] ] } !! wikitext ''Foo'' !! wikitext/edited ''[[Foo]]'' !! end !! test 7. T194083 Regression test: Manual edit test to ensure nested diff markers aren't inserted !! options parsoid={ "modes": ["selser"], "changes": [ ["div", "after", "\n

      Foo , placeholder

      "] ] } !! wikitext
      placeholder
      !! wikitext/edited
      placeholder
      [[Foo]] , placeholder !! end ## No sort-key or templated sort-key !! test T192913 Regression test: 1. html2wt of links should not trip on parser functions found in target !! options parsoid !! wikitext [[Category:Bugs-{{#if:blah|Regression|None}}]] [[Category:Bugs-{{#if:blah|Regression|None}}|{{#if:blah|2020|None}}-#fragment]] !! html/parsoid !! end ## Untemplated sort-key (wt2html data-mw is missing sort-key information!) !! test T192913 Regression test: 2. html2wt of links should not trip on parser functions found in target (2) !! options parsoid !! wikitext [[Category:Bugs-{{#if:blah|Regression|None}}|fragment]] [[Category:Bugs-{{#if:blah|Regression|None}}-{{#if:blah|2020|None}}|fragment]] !! html/parsoid !! end #------------------------------ # End of tag minimization tests #------------------------------ !!test T56262: New entities !! options parsoid=html2wt !! html/parsoid   !! wikitext   !! end ## Note that there is no wikitext output for 'unknownproperty' ## ## Unknown magic words are silently dropped ## !! test Magic words !! options parsoid=html2wt !! html/parsoid !! wikitext __TOC__ __NOTOC__ __FORCETOC__ __INDEX__ __NOINDEX__ __NOGALLERY__ __NOEDITSECTION__ __NOTITLECONVERT__ __NOCONTENTCONVERT__ !! end !! test Consecutive
      s should not get merged
      !! options
      parsoid=html2wt,html2html
      !! html/parsoid
      
      a
      b
      c
      
      d
      e
      
      
      
      f
      !! wikitext a b c d e f !! end !! test Edited ISBN links not serializable as ISBN links should serialize as wikilinks !! options parsoid=html2wt !! html/parsoid ISBN 1234567895 !! wikitext [[Special:BookSources/1234567890|ISBN 1234567895]] !! end !! test Edited RFC links not serializable as RFC links should serialize as extlinks !! options parsoid=html2wt !! html/parsoid New RFC !! wikitext [https://tools.ietf.org/html/rfc123 New RFC] !! end !! test Edited PMID links not serializable as PMID links should serialize as extlinks !! options parsoid=html2wt !! html/parsoid New PMID !! wikitext [//www.ncbi.nlm.nih.gov/pubmed/123?dopt=Abstract New PMID] !! end !! test WTS of autolinks with trailing/surrounding context !! options parsoid=html2wt !! html/parsoid

      http://cscott.netfoo

      http://cscott.netfoo

      http://cscott.net

      http://cscott.net

      http://cscott.netx

      http://cscott.netx

      !! wikitext http://cscott.net'''foo''' http://cscott.netfoo '''http://cscott.net''' '''http://cscott.net ''' '''http://cscott.netx''' http://cscott.netx !! end !! test WTS of autolinks with nowikis (round-trip) !! wikitext xhttp://cscott.netx !! html/parsoid

      xhttp://cscott.netx

      !! end # this is the "easy" test because it leaves in place all the # data-parsoid information indicating this is an autolink !! test WTS of autolinks with escapes (editing) !! options parsoid={ "modes": ["wt2wt"], "changes": [ [ "span", "remove" ] ] } !! wikitext xhttp://cscott.netx !! wikitext/edited xhttp://cscott.netx !! end !! test WTS of edited autolink-like text (T103364) !! options parsoid={ "modes": ["wt2wt"], "changes": [ [ "span[typeof]", "removeAttr", "typeof" ] ] } !! wikitext Not a link: http://example.com. !! wikitext/edited Not a link: http://example.com. !! end !! test WTS of newly-authored autolink-like text (T103364) !! options parsoid=html2wt !! html/parsoid

      http://example.com is not a link.

      !! wikitext http://example.com is not a link. !! end !! test WTS of autolink-like text after an autolink (T108563) !! options parsoid=html2wt !! html/parsoid

      http://example.com http://example.com is not a link.

      !! wikitext http://example.com http://example.com is not a link. !! end !! test WTS of an autolink surrounded by square brackets (T220018) !! options parsoid=html2wt !! html/parsoid

      [http://example.com]

      !! wikitext [http://example.com] !! end !! test WTS of edited autolink surrounded by square brackets (T220018) !! options parsoid={ "modes": ["wt2wt"], "changes": [ [ "a", "before", "[" ], [ "a", "after", "]" ] ] } !! wikitext http://example.com !! wikitext/edited [http://example.com] !! end !! test WTS of an external link surrounded by square brackets (T220018) !! options parsoid=html2wt !! html/parsoid

      [foo]

      !! wikitext [[http://example.com foo]] !! end !! test WTS of edited external link surrounded by square brackets (T220018) !! options parsoid={ "modes": ["wt2wt"], "changes": [ [ "a", "before", "[" ], [ "a", "after", "]" ] ] } !! wikitext [http://example.com foo] !! wikitext/edited [[http://example.com foo]] !! end !! test Magic links inside links (not autolinked) !! wikitext [[Foo|http://example.com]] [[Foo|RFC 1234]] [[Foo|PMID 1234]] [[Foo|ISBN 123456789x]] [http://foo.com http://example.com] [http://foo.com RFC 1234] [http://foo.com PMID 1234] [http://foo.com ISBN 123456789x] !! html/php

      http://example.com RFC 1234 PMID 1234 ISBN 123456789x

      http://example.com RFC 1234 PMID 1234 ISBN 123456789x

      !! html/parsoid

      http://example.com RFC 1234 PMID 1234 ISBN 123456789x

      http://example.com RFC 1234 PMID 1234 ISBN 123456789x

      !! end !! test WTS of magic word text (T109371) !! options parsoid=html2wt !! html/parsoid

      RFC 1234

      RFC 1234

      RFC 1234

      !! wikitext RFC 1234 [http://foo.com RFC 1234] [[Foo|RFC 1234]] !! end !! test Edited Redirect link should emit a non-piped wikitext link !! options parsoid=html2wt !! html/parsoid !! wikitext #REDIRECT [[Bar]] !! end !! test T75121: Infer extension name from typeOf if data-mw is not present !! options parsoid={ "modes": ["html2wt"], "suppressErrors": true } !! html/parsoid
      !! wikitext !! end # Note that the

      wrapping isn't present in PHP parser output # The important thing for this test is that P-wrapping doesn't # interfere with the protection for leading - in # (which isn't necessary for ). !! test T88318: p-wrapped dash in table. !! options parsoid=html2wt,wt2wt !! html/parsoid

      -

      -

      -

      -

      -

      -


      -
      !! wikitext {| !- !- |- |- |- |- |- |
      - |
      - |} !! html/php
      - -
      - -
      -

      -


      -
      !! end !! test T149209: WTS: Handle newlines in table cells properly !! options parsoid=html2wt !! html/parsoid
      a b c

      x

      y
      a b c

      x

      y
      !! wikitext {| |a b |c |- |x {{!}}y |} {| !a b !c |- !x !y |} !! end !! test T149209: Selser: Handle newlines in table cells properly !! options parsoid={ "modes": ["selser"], "changes": [ [ "#h1", "html", "a\nb\n" ], [ "#h2", "html", "a\nb\n" ], [ "#c1", "html", "a\nb\n" ], [ "#c2", "html", "

      a

      " ], [ "#c3", "html", "

      a

      " ], [ "#c4", "html", "edit-me

      a

      " ] ] } !! wikitext {| ! id="h1" |edit-me!!1 |- ! id="h2" |edit-me||2 |- | id="c1" |edit-me||3 |- | id="c2" |edit-me||4 |- | id="c3" |edit-me||p||q||r |- | id="c4" |edit-me||p||q||r |} !! wikitext/edited {| ! id="h1" |a b !1 |- ! id="h2" |a b !2 |- | id="c1" |a b |3 |- | id="c2" |a |4 |- | id="c3" |a |p||q||r |- | id="c4" |edit-me a |p||q||r |} !! end !! test HTML id attribute with Parsoid-like element ids should not be serialized to wikitext !! options parsoid=html2wt !! html/parsoid
      foo bar
      !! wikitext {| |foo | id="serialize-this" |bar |} !! end !! test Parsoid-like element ids should not be serialized to wikitext unless shadowed !! options parsoid=html2wt !! html/parsoid
      ok
      !! wikitext
      ok
      !! end !! test Testing serialization after deletion in references !! options parsoid={ "modes": ["wt2wt"], "changes": [ ["#x", "remove"] ] } !! wikitext hi
      ho
      !! wikitext/edited hi !! end !!test Testing serialization after deletion of table cells !!options parsoid={ "modes": ["wt2wt", "selser"], "changes": [ ["#x", "remove"] ] } !!wikitext {| !h1 !!h2 !!h3 | id="x" |c1 {{!}}{{!}}{{!}}c2 |||c3 |} !! wikitext/edited {| !h1!!h2!!h3 |c2|||c3 |} !!end !! test Testing selser after addition of new row before first row (T125419) !! options parsoid={ "modes": ["wt2wt", "selser"], "changes": [ [ "tr", "before", "X" ] ] } !! wikitext {| |a |} !! wikitext/edited {| |X |- |a |} !! end !! test Serialize new table rows in a HTML table using HTML tags !! options parsoid={ "modes": ["wt2wt", "selser"], "changes": [ [ "tr", "before", "X" ] ] } !! wikitext
      a
      !! wikitext/edited
      X
      a
      !! end !! test Serialize new table cells in a HTML row using HTML tags !! options parsoid={ "modes": ["wt2wt", "selser"], "changes": [ [ "td", "before", "X" ] ] } !! wikitext
      a
      !! wikitext/edited
      Xa
      !! end !! test Serialize wikitext list items as HTML list items when embedded in a HTML list !! options parsoid=html2wt !! html/parsoid
      • a
      • b
      !! wikitext
      • a
      • b
      !! html/php
      • a
      • b
      !! end # Nested list should be inside
    • , that is #
      • foo
          ..
      instead of #
      • foo
        • ..
      # See https://stackoverflow.com/questions/5899337/proper-way-to-make-html-nested-list !! test Wikitext lists can be nested inside HTML lists !! options parsoid=html2wt !! html/parsoid
      • a
        • b
      • x
        • y
      !! wikitext
      • a * b
      • x * y
      !! html/php
      • a
        • b
      • x
        • y
      !! end !! test WTS change modes !! options parsoid={ "modes": ["wt2wt"], "changes": [ [ "#xyz", "before", "before stuff " ], [ "#xyz", "after", " stuff after" ], [ "#xyz", "html", "x y z" ] ] } !! wikitext hello !! wikitext/edited '''before''' stuff x '''y''' z stuff ''after'' !! end !! test Never serialize a-tag as html, regardless of what data-parsoid has to say !! options parsoid={ "modes": ["html2wt"], "suppressErrors": true } !! html/parsoid Foo !! wikitext [[Foo]] !! end ## SSS FIXME: This is broken output nevertheless. ## What might be a reasonable non-broken output for this? ## This is an edge case unlikely to be seen in production ## that I am not wasting more time on this right now. !! test Never serialize a-tag as html, no matter what attributes it has !! options parsoid={ "modes": ["html2wt"], "suppressErrors": true } !! html/parsoid !! wikitext [http://boo.org http://boohoo.org] !! end # Misnested is an indication that selser can reuse the source but these have # shown to sneak through on occasion. See T101768. # The original wikitext here is: [http://test.com [[one]] two three] !! test Strip span tags added to mark misnested links !! options parsoid=html2wt !! html/parsoid

      one two three

      !! wikitext [http://test.com][[one]] two three !! end !! test Catch regression when unpacking misnested links !! options parsoid=wt2html !! wikitext {{1x|hi}}[http://example.com [[ho]]] !! html/parsoid

      hiho

      !! end !! test Catch regression when unpacking with trailing content !! wikitext {{1x|Foo bar}} !! html/parsoid

      Foo

        bar

        !! end !! test Use data-parsoid.firstWikitextNode to compute newline constraints for template content !! options parsoid=html2wt !! html/parsoid a
        d
        !! wikitext {{1x|a}} {|{{1x|c {{!}}d }} |} !! end ## This test verifies the presence and computation of this attribute indirectly ## by making an edit and ensuring that the serialization is correct (which it would be ## only if firstWikitextNode is properly set). !! test data-parsoid.firstWikitextNode should be computed properly in the presence of fostered content !! options parsoid= { "modes": ["wt2wt"], "changes": [ [ "div#x", "remove" ], [ "div", "before", "
        new
        " ] ] } !! wikitext
        foo
        {| {{1x|
        boo
        {{!}}b}} |c |} !! wikitext/edited
        new
        {| {{1x|
        boo
        {{!}}b}} |c |} !! end # -------------------------------------------- # Tests spec'ing wikitext serialization norms | # -------------------------------------------- !! test Serialize multi-line indent-pre starting with wikitext syntax !! options parsoid=html2wt !! html/parsoid
        * 1
        ** 2
        * 3
        !! wikitext * 1 ** 2 * 3 !! end !! test 1. Categories should always be serialized on their own line !! options parsoid=html2wt !! html/parsoid foobar !! wikitext foo [[Category:Foo]] bar !! end !! test 2. Categories that are part of templates should not introduce a line break !! wikitext foo {{1x|bar [[Category:baz]]}} bar !! html/parsoid

        foo bar bar

        !! end # Careful while editing these next 2 tests. There are \u200f characters # before and after the tags in the HTML and following some # of the categories in wikitext # Do not remove these characters in edits. # # As part of the serialization, these bidi characters will get stripped. !! test RTL (\u200f) and LTR (\u200e) markers around category tags should be stripped !! options parsoid={ "modes": ["html2wt"] } !! html/parsoid

        ‏ ‏

        !! wikitext [[קטגוריה:טקסים]] [[קטגוריה: שיטות משפט]] !! end !! test RTL (\u200f) and LTR (\u200e) markers should not be stripped if followed by a text node !! options parsoid={ "modes": ["html2wt"] } !! html/parsoid

        ‏y

        !! wikitext [[קטגוריה:טקסים]] ‏y !! end !! test Lists: Add space after bullets !! options parsoid=html2wt !! html/parsoid
        • foo
        • bar
        • baz
        !! wikitext * foo * bar * baz !! end !! test 1. Headings: Add space before/after == (T53744) !! options parsoid=html2wt !! html/parsoid

        foo

        bar

        baz

        baz

        !! wikitext == foo == == bar == == baz == == baz == !! end !! test 2. Headings: Add space before/after == even after hoisted content !! options parsoid={ "modes": ["html2wt"] } !! html/parsoid

        ok

        !! wikitext [[Category:A2]] == ok == !! end !! test 1. Headings: suppress newly created empty headings !! options parsoid={ "modes": ["html2wt"] } !! html/parsoid

        !! wikitext !! end !! test 2. Headings: suppress empty headings on edits !! options parsoid={ "modes": ["selser"], "changes": [ [ "#x", "remove"] ] } !! wikitext ==foo== !! wikitext/edited !! end !! test Headings: Replace
        with a single whitespace char !! options parsoid={ "modes": ["html2wt"] } !! html/parsoid

        foo
        bar

        foo
        bar
        baz

        !! wikitext == foo bar == == foo bar baz == !! end !! test 1. WT Quote Tags: suppress newly created empty style tags !! options parsoid={ "modes": ["html2wt"] } !! html/parsoid !! wikitext !! end !! test 2. WT Quote Tags: suppress empty style tags on edits !! options parsoid={ "modes": ["selser"], "changes": [ [ "#x", "remove"] ] } !! wikitext '''foo''' !! wikitext/edited !! end !! test 1. Anchors: suppress newly created empty anchors !! options parsoid={ "modes": ["html2wt"] } !! html/parsoid !! wikitext !! end !! test 2. Anchors: suppress empty anchors on edits !! options parsoid={ "modes": ["selser"], "changes": [ [ "#x", "remove"] ] } !! wikitext [[Test|foo]] !! wikitext/edited !! end !! test 3a. Anchors: do not suppress numbered extlinks !! options parsoid={ "modes": ["wt2wt"] } !! wikitext [http://foo.com] !! html/parsoid !! end !! test 3b. Anchors: do not suppress numbered extlinks !! options parsoid={ "modes": ["wt2wt"], "changes": [ [ "#x", "remove"] ] } !! wikitext [http://foo.com foo] !! wikitext/edited [http://foo.com] !! end !!test Normalizations should be restricted to edited content !!options parsoid={ "modes": ["selser"], "changes": [ [ "h1", "before", ""] ] } !!wikitext a = = b !!wikitext/edited a = = b !!end !! test 1. Multiple normalizations (html2wt) !! options parsoid={ "modes": ["html2wt"] } !! html/parsoid

        foo x

        !! wikitext [[foo]] x !! end !! test 2. Multiple normalizations (selser) !! options parsoid={ "modes": ["selser"], "changes": [ [ "#x", "after", "

        \n

        bar

        "] ] } !! wikitext
        foo
        !! wikitext/edited
        foo
        bar !! end !! test 1. Indent Pre Nowiki: suppress whitespace at the start of new paragraph !! options parsoid={ "modes": ["html2wt"] } !! html/parsoid

        hi

        hello

        !! wikitext hi hello !! end !! test 2. Indent Pre Nowiki: suppress whitespace after newlines in new paragraph or table cell !! options parsoid={ "modes": ["html2wt"] } !! html/parsoid

        Foo bar baz

        Foo bar baz bang

        foo bar

        foo barboo

        !! wikitext Foo bar baz {| |Foo bar baz bang |} foo bar foo barboo !! end !! test 3. Indent Pre Nowiki: suppress leading whitespace in edited paragraphs !! options parsoid={ "modes": ["selser"], "changes": [ [ "p", "html", " a\n b" ] ] } !! wikitext xyz !! wikitext/edited a b !! end !! test New links that end in spaces !! options parsoid={ "modes": ["html2wt"] } !! html/parsoid

        Berlin is the capital of Germany.

        Foo bar

        Boston is a city.

        !! wikitext [[Berlin]] is the capital of Germany. [[Foo]] '''bar''' [[Boston]] is a city. !! end !! test 1. Table cells with escapable prefixes !! options parsoid={ "modes": ["html2wt"] } !! html/parsoid
        a
        -
        +
        }
        !! wikitext {| |a |- | - |- | + |- | } |} !! end !! test 2a. Table cells with escapable prefixes after edits !! options parsoid={ "modes": ["selser"], "changes": [ [ "table tbody tr:first-child td:first-child", "remove"] ] } !! wikitext {| |a||- |} !! wikitext/edited {| | - |} !! end !! test 2b. Table cells with escapable prefixes after edits !! options parsoid={ "modes": ["selser"], "changes": [ [ "table tbody tr:first-child td:first-child", "html", "-" ], [ "#x", "remove" ] ] } !! wikitext {| |pqr |foo+ |} !! wikitext/edited {| | - | + |} !! end # FIXME: This test will fail because # normalization doesn't realize that the id attribute # will eliminate the escapable scenario !! test 3a. Table cells without escapable prefixes after edits !! options parsoid={ "modes": ["selser"], "changes": [ [ "#x", "html", "-" ] ] } !! wikitext {| | id="x" |abcd |} !! wikitext/edited {| | id="x" |- |} !! end ## This tests normalizer's ability to discriminate between ## cells having identical content. !! test 3b. Table cells without escapable prefixes after edits !! options parsoid={ "modes": ["selser"], "changes": [ [ "td", "html", "-" ] ] } !! wikitext {| |a||b |} !! wikitext/edited {| | -||- |} !! end ## This tests normalizer's ability to not be tripped by ## comments (and whitespace) !! test 3c. Table cells without escapable prefixes after edits !! options parsoid={ "modes": ["selser"], "changes": [ [ "table tbody tr td:first-child", "remove" ] ] } !! wikitext {| |- |a||- |} !! wikitext/edited {| |- | - |} !! end ## This tests normalizer's ability to handle HTML cells !! test 3d. Table cells without escapable prefixes after edits !! options parsoid={ "modes": ["selser"], "changes": [ [ "td", "html", "-" ] ] } !! wikitext
        a
        !! wikitext/edited
        -
        !! end ## T111151 Remove font elements without attributes !! test 4. font tags without attributes should be dropped !! options parsoid={ "modes": ["html2wt"] } !! html/parsoid foo bar boo !! wikitext foo bar boo !! end !! test Normalize empty paragraphs to HTML form that html2wt expects !! options parsoid={ "modes": ["html2wt"] } !! html/parsoid
        1

        a

        b

        2

        a

        b

        3

        a

        b

        4

        a

        foo
        !! wikitext
        1
        a b
        2
        a b
        3
        a b
        4
        a
        foo
        !! html/php
        1

        a


        b

        2

        a


        b

        3

        a



        b

        4

        a

        foo
        !! end !! test Templated content should be skipped over by normalization !! options parsoid={ "modes": ["html2wt"] } !! html/parsoid

        foobar

        foobar

        !! wikitext {{SomeTemplate1|boo}}{{SomeTemplate2|booboo}} !! end !! test Escape DOM elements !! options parsoid=html2wt !! html/parsoid foo foo foo !! wikitext <nowiki>''foo''</nowiki> <noinclude>''foo''</noinclude> <includeonly>''foo''</includeonly> !! end !! test Don't escape pre elements that fail to parse as extension tags !! wikitext
        closed is extension tag, so everything is text
        unclosed is not, so these are tags
        !! html/php
        
        closed is extension tag, so everything is <span>text</span>
        unclosed is not, so these are tags
        !! html/parsoid
        closed is extension tag, so everything is <span>text</span>
        unclosed is not, so these are tags
        !! end !! test New list is serialized on newlines !! options parsoid=html2wt !! html/parsoid

        The quick brown fox jumps over the lazy dog.

        • Yesterday
        • Today
        • Tomorrow

        The quick onyx goblin jumps over the lazy dwarf.

        !! wikitext The quick brown fox jumps over the lazy dog. * Yesterday * Today * Tomorrow The quick onyx goblin jumps over the lazy dwarf. !! end !! test New lists in formatting elements serialized w/o newlines !! options parsoid=html2wt !! html/parsoid
        • 123
        • hi
        !! wikitext * 123 * hi !! end !! test New list in table doesn't need newlines !! options parsoid=html2wt !! html/parsoid
        • test
        • 123
        !! wikitext {| | * test * 123 |} !! end !! test Newly inserted noinclude tags do not need newlines before/after !! html/parsoid

        abc

        !! wikitext abc !! end # --------------------------------------------------- # End of tests spec'ing wikitext serialization norms | # --------------------------------------------------- # T104032 !! test Bare inline nodes not wrapped inside p-tags should be treated as p-wrapped !! options parsoid=html2wt !! html/parsoid a

        b

        c

        d

        a

        b

        c

        d

        !! wikitext a b '''c''' d {| |a b |'''c''' d |} !! end !! test Anchor without href scenarios !! options parsoid={ "modes": ["html2wt"], "suppressErrors": true } !! html/parsoid dice !! wikitext dice !! end !! test New transclusion added after a list should be serialized after the list !! options parsoid=html2wt !! html/parsoid
        • a
        foo !! wikitext * a {{1x|foo}} !! end ## FIXME: This test is less useful now that the leading space is normalized away !! test Only html p-tag is strong indent pre suppressing !! options parsoid=html2wt !! html/parsoid

        test2 test3

        !! wikitext test2 test3 !! end # Clients like VE don't know about this property (T238721) !! test T238721: New transclusion without the "i" property for a template part should be handled properly !! options parsoid=html2wt !! html/parsoid foo !! wikitext {{1x}} !! end # ----------------------------------------------------------------- # End of section for Parsoid-only html2wt tests for serialization # of new content # ----------------------------------------------------------------- # ----------------------------------------------------------------- # The following section of tests are primarily to spec behavior of # the selective serializer. All these tests have manual selser # changes. The automated selser changes for all tests handle the # wide variation of changes, but these tests here capture specs # deterministically. # ---------------------------------------------------------------- ## T90517 !! test Selser: New comments should not be lost !! options parsoid={ "modes": ["selser"], "changes": [ [ "#a", "after", "" ], [ "#b", "before", "" ] ] } !! wikitext a b !! wikitext/edited a b !! end ## T89383 !! test Selser: Check for validity of DSR before using it !! options parsoid={ "modes": ["selser"], "changes": [ [ "#a", "before", "" ] ] } !! wikitext a !! wikitext/edited {{DISPLAYTITLE:foo}} a !! end !! test 1. DOMDiff: Changes to content should be looked up using id !! options parsoid={ "modes": ["selser"], "changes": [ ["#X", "after", "bar"], ["#Y", "after", "baz"] ] } !! wikitext X foo Y foo !! wikitext/edited X foobar Y foobaz !! end !! test 2. DOMDiff: Changes to content should be looked up using id !! options parsoid={ "modes": ["selser"], "changes": [ ["#Z", "after", "bar"] ] } !! wikitext A foo bar for a B foo !! wikitext/edited A foo bar for a B foobar !! end !! test DOMDiff: Edits to content nested in elements with templated attributes should not be lost (T139388) !! options parsoid={ "modes": ["selser"], "changes": [ [ "div:first-child", "text", "bar" ] ] } !! wikitext
        foo
        !! wikitext/edited
        bar
        !! end !! test Empty LI (T49673) !! wikitext *a * * *b !! html
        • a
        • b
        !! end !! test unclosed internal link XSS (T137264) !! wikitext [[#%3Cscript%3Ealert(1)%3C/script%3E| !! html/php

        [[#<script>alert(1)</script>|

        !! html/parsoid

        [[#%3Cscript%3Ealert(1)%3C/script%3E|

        !! end !! test Validating that !! html/php
        !! html/parsoid
        !! end ## Right now, Parsoid doesn't de-duplicate style tags. ## So, we shouldn't see link tags that need to bypass the sanitizer. ## In a followup patch, when we de-duplicate style tags and ## introduce link tags, we'll add a hook for link tags in ## the parser test runner script. !! test Validating that But if it's on a line with other content, let it be wrapped. bar foo foo bar And the same if we have non-paragraph-breaking whitespace foo bar !! html/php

        A style tag, by itself or with other style/link tags, shouldn't be wrapped in a paragraph

        But if it's on a line with other content, let it be wrapped.

        bar

        foo

        foo bar

        And the same if we have non-paragraph-breaking whitespace

        foo bar

        !! html/parsoid

        A style tag, by itself or with other style/link tags, shouldn't be wrapped in a paragraph

        <link rel="foo" href="bar"/>

        But if it's on a line with other content, let it be wrapped.

        bar

        foo

        foo bar

        And the same if we have non-paragraph-breaking whitespace

        foo bar

        !! end !! test Validating that isn't wrapped in a paragraph (T186965) !! options styletag=1 !! wikitext A link tag, by itself or with other style/link tags, shouldn't be wrapped in a paragraph But if it's on a line with other content, let it be wrapped. bar foo foo bar And the same if we have non-paragraph-breaking whitespace foo bar !! html/php

        A link tag, by itself or with other style/link tags, shouldn't be wrapped in a paragraph

        But if it's on a line with other content, let it be wrapped.

        bar

        foo

        foo bar

        And the same if we have non-paragraph-breaking whitespace

        foo bar

        !! end !! test Extension returning multiple nodes starting with a style tag roundtrips !! options wgRawHtml=1 !! wikitext {{1x|}}
        ho
        !! html/parsoid

        ho
        !! end !! test Decoding of HTML entities in headings and links for IDs and link fragments (T103714) !! config wgFragmentMode=[ "html5", "legacy" ] !! wikitext ==A&B&C&amp;D&amp;amp;E== [[#A&B&C&amp;D&amp;amp;E]] !! html/php

        A&B&C&amp;D&amp;amp;E[edit]

        #A&B&C&amp;D&amp;amp;E

        !! html/parsoid

        A&B&C&amp;D&amp;amp;E

        #A&B&C&amp;D&amp;amp;E

        !! end !! test Decoding of HTML entities in headings and links for IDs and link fragments (T103714) (legacy) !! config wgFragmentMode=[ "legacy" ] !! wikitext ==A&B&C&amp;D&amp;amp;E== [[#A&B&C&amp;D&amp;amp;E]] !! html/php

        A&B&C&amp;D&amp;amp;E[edit]

        #A&B&C&amp;D&amp;amp;E

        !! end !! test Decoding of HTML entities in embedded HTML tags !! wikitext
        x
        !! html/php
        x
        !! html/parsoid
        x
        !! end !! test Decoding of HTML entities in indicator names for IDs (T104196) !! options parsoid=wt2html,html2html showindicators !! wikitext Indicator !! metadata 1&2&3&4&amp;5=Indicator !! html/php !! html/parsoid

        !! end # this version of the test strips out the ambiguity so Parsoid rts cleanly !! test Decoding of HTML entities in indicator names for IDs (unambiguous) (T104196) !! options showindicators !! wikitext Indicator !! metadata 1&2&3&4&amp;5=Indicator !! html/php !! html/parsoid

        !! end # This fragment mode is what Parsoid supports. !! test HTML5 ids: fallback to legacy !! config wgFragmentMode=[ "html5", "legacy" ] !! wikitext ==Foo bar== ==foo Bar== ==Тест== ==Тест== ==тест== ==Hey < # " > % : '== [[#Foo bar]] [[#foo Bar]] [[#Тест]] [[#тест]] [[#Hey < # " > % : ']] {{anchorencode:💩}} [[#啤酒]] [[#%E5%95%A4%E9%85%92]] !! html/php

        Foo bar[edit]

        foo Bar[edit]

        Тест[edit]

        Тест[edit]

        тест[edit]

        Hey < # " > % : '[edit]

        #Foo bar #foo Bar #Тест #тест #Hey < # " > % : '

        💩

        #啤酒 #啤酒

        !! html/parsoid

        Foo bar

        foo Bar

        Тест

        Тест

        тест

        Hey < # " > % : '

        #Foo bar #foo Bar #Тест #тест #Hey < # " > % : '

        💩

        #啤酒 #啤酒

        !! end # Parsoid doesn't support this mode !! test HTML5 ids: legacy with a fallback to modern !! config wgFragmentMode=[ "legacy", "html5" ] !! wikitext ==Foo bar== ==foo Bar== ==Тест== ==Тест== ==тест== ==Hey < # " > % : '== [[#Foo bar]] [[#foo Bar]] [[#Тест]] [[#тест]] [[#Hey < # " > % : ']] {{anchorencode:💩}} [[#啤酒]] [[#%E5%95%A4%E9%85%92]] !! html/php

        Foo bar[edit]

        foo Bar[edit]

        Тест[edit]

        Тест[edit]

        тест[edit]

        Hey < # " > % : '[edit]

        #Foo bar #foo Bar #Тест #тест #Hey < # " > % : '

        .F0.9F.92.A9

        #啤酒 #啤酒

        !! end # Parsoid doesn't support this mode. !! test HTML5 ids: no legacy !! config wgFragmentMode=[ "html5" ] !! wikitext ==Foo bar== ==foo Bar== ==Тест== ==Тест== ==тест== ==Hey < # " > % : '== [[#Foo bar]] [[#foo Bar]] [[#Тест]] [[#тест]] [[#Hey < # " > % : ']] {{anchorencode:💩}} [[#啤酒]] [[#%E5%95%A4%E9%85%92]] !! html/php

        Foo bar[edit]

        foo Bar[edit]

        Тест[edit]

        Тест[edit]

        тест[edit]

        Hey < # " > % : '[edit]

        #Foo bar #foo Bar #Тест #тест #Hey < # " > % : '

        💩

        #啤酒 #啤酒

        !! end !! test T90902: Normalize weird characters in section IDs !! config wgFragmentMode=[ "html5", "legacy" ] !! wikitext ==Foo bar== [[#Foo bar]] !! html/php

        Foo bar[edit]

        #Foo bar

        !! html/parsoid

        Foo bar

        #Foo bar

        !! end !! test T51672: Test for brackets in attributes of elements in external link texts !! wikitext [http://example.com/ link span] [http://example.com/ link span] !! html/php

        link span link span

        !! html/parsoid

        link span link span

        !! end !! test T72875: Test for brackets in attributes of elements in internal link texts !! wikitext [[Foo|link span]] [[Foo|link span]] !! html/php

        link span link span

        !! html/parsoid

        link span link span

        !! end !! test T199926: html arrow wt: Parsoid sometimes trips up on verticalbar chars in hrefs !! options parsoid={ "modes": ["html2wt"] } !! html/parsoid 9 10 !! wikitext [https://stats.wikimedia.org/v2/#/fr.wikipedia.org/reading/page-views-by-country/normal|map|2-Year~2016060100~2018071100|~total 9] [[stats:v2/#/fr.wikipedia.org/reading/page-views-by-country/normal%7Cmap%7C2-Year~2016060100~2018071100%7C~total|10]] !! end !! test T199926: Hash only interwiki link !! config wgFragmentMode=[ "html5" ] !! wikitext [[meatball:Test#1/2]] [[gerrit:#/q/project:mediawiki/services/parsoid|Gerrit]] !! html/php

        meatball:Test#1/2 Gerrit

        !! html/parsoid

        meatball:Test#1/2 Gerrit

        !! end !! test T179544: {{anchorencode:}} output should be always usable in links !! config wgFragmentMode=[ "html5" ] !! wikitext [[#{{anchorencode:[foo]}}]] !! html/php

        #[foo]

        !! html/parsoid

        #[foo]

        !! end ########################################################################## # Tests demonstrating white-space insensitivity in input wikitext # for wikitext headings, wikitext list items, and wikitext table captions, # headings, and cells. HTML versions of the same should preserve whitespace. ########################################################################## !! test Trim whitespace in wikitext headings, list items, table captions, headings, and cells !! options parsoid={ "modes": ["wt2html"], "preserveIEW": true } !! wikitext __NOTOC__ == Spaces == == Tabs == == Личная жизнь == * List item ; term : definition {| |+ Table Caption |- ! Table Heading 1 !! Table Heading 2 |- | Table Cell 1 || Table Cell 2 |- | class="foo" || Table Cell 3 |- | testing [[one|two]] | some content |} : {| | Table Cell 1 || Table Cell 2 |} foo !! html/php

        Spaces[edit]

        Tabs[edit]

        Личная жизнь[edit]

        • List item
        term
        definition
        Table Caption
        Table Heading 1 Table Heading 2
        Table Cell 1 Table Cell 2
        class="foo" Table Cell 3
        testing two | some content
        Table Cell 1 Table Cell 2
        foo
        !! html/parsoid

        Spaces

        Tabs

        Личная жизнь

        • List item
        term
        definition
        Table Caption
        Table Heading 1Table Heading 2
        Table Cell 1Table Cell 2
        class="foo"Table Cell 3
        testing two | some content
        Table Cell 1Table Cell 2
        foo
        !! end # Looks like is not accepted in HTML !! test Do not trim whitespace in HTML headings, list items, table captions, headings, and cells !! options parsoid={ "modes": ["wt2html"], "preserveIEW": true } !! wikitext __NOTOC__

        Heading

        • List item
        Table Heading
        Table Cell
        !! html/php

        Heading

        • List item
        Table Heading
        Table Cell
        !! html/parsoid

        Heading

        • List item
        Table Heading
        Table Cell
        !! end !! test Do not trim whitespace in links and quotes !! options parsoid={ "modes": ["wt2html"], "preserveIEW": true } !! wikitext foo '' italic '' and ''' bold ''' [[Foo| some text ]] !! html/php

        foo italic and bold some text

        !! html/parsoid

        foo italic and bold some text

        !! end !! test Remove p tags surrounding a single element in a figcaption !! options parsoid=html2wt !! wikitext [[File:Foobar.jpg|right|200x200px|Caption]] !! html/parsoid

        Caption

        !! end !! test Selser preserves lack of newline before list and allows newline after the list !! options parsoid={ "modes": ["selser"], "changes": [ [ "ul", "after", "

        footer

        " ] ] } !! wikitext header *foo *bar !! wikitext/edited header *foo *bar footer !! end !! test Selser does not introduce newlines between unedited paragraph preceding the list !! options parsoid={ "modes": ["selser"], "changes": [ [ "table tbody tr td p:last-child", "empty" ] ] } !! wikitext {| | header *foo *bar footer |} !! wikitext/edited {| | header *foo *bar |} !! end !! test Selser does not introduce newlines between unedited paragraph following the list !! options parsoid={ "modes": ["selser"], "changes": [ [ "table tbody tr td p:first-child", "empty" ] ] } !! wikitext {| | header *foo *bar footer |} !! wikitext/edited {| | *foo *bar footer |} !! end !! test Remove a list item but do not insert newline above list !! options parsoid={ "modes": ["selser"], "changes": [ [ "ul li:last-child", "remove" ] ] } !! wikitext header *foo *bar footer !! wikitext/edited header *foo footer !! end !! test Spaced heading with element !! options parsoid={ "modes": ["selser"], "changes": [ ["#x", "attr", "class", "y"] ] } !! wikitext === hi hi hi ho === !! wikitext/edited === hi hi hi ho === !! end !! test Allow tabindex 0 !! wikitext
        A
        !! html
        A
        !! end !! test Don't allow tabindex -1 !! options parsoid=wt2html !! wikitext
        A
        !! html
        A
        !! end !! test Don't Allow tabindex > 0 !! options parsoid=wt2html !! wikitext
        A
        !! html
        A
        !! end !! test aside tag in extension HTML is not p-wrapped (T278565) !! wikitext This is some article content. !! html/php

        This is some article content.

        !! html/parsoid

        This is some article content.

        !! end !! test aside tag is not allowed directly in wikitext (T278565) !! wikitext !! html

        <aside>This aside tag in wikitext should be escaped</aside>

        !! end !! test Stripped tag in list !! options parsoid={ "modes": ["selser"], "selser": "noauto", "changes": [ ["dd", "append", "ho"] ] } !! wikitext :hi !! wikitext/edited :hiho !! end !! test Misnested link nested in span !! options parsoid={ "modes": ["selser"], "selser": "noauto", "changes": [ ["dd", "append", " ho"] ] } !! wikitext : [http://google.com [[Lala]]:ok]-hi !! wikitext/edited : [http://google.com [[Lala]]:ok]-hi ho !! end ## From T290938, wrapper unmodified was prevented due to the auto-inserted end !! test Preserve the order invalid attributes !! options parsoid={ "modes": ["selser"], "selser": "noauto", "changes": [ ["div", "append", "ho"] ] } !! wikitext
        hi !! wikitext/edited
        hiho !! end