# 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 # This is the standard article assumed to exist. !! article Main Page !! text blah blah !! endarticle !!article Foo !!text FOO !!endarticle !! article Söfnuður !! text Test. !! endarticle !! article 00 !! text This is 00. !! endarticle !! article Template:1x !! text {{{1}}} !! endarticle #### ---------------------------------------------------------------- #### The following section of tests are primarily to test #### wikitext escaping capabilities of Parsoid. Given that #### escaping can be done any number of ways, the wikitext (input) #### is always adjusted to reflect how Parsoid adds nowiki #### escape tags. #### #### We are marking several tests as parsoid-only since the #### HTML in the result section is different from what the #### PHP parser generates for it. #### ---------------------------------------------------------------- #### --------------- Headings --------------- #### 0. Unnested #### 1. Nested inside html

=foo=

#### 2. Outside heading nest on a single line

foo

*bar #### 3. Nested inside html with wikitext split by html tags #### 4. No escape needed #### 5. Empty headings

#### 6. Heading chars in SOL context #### ---------------------------------------- !! test Headings: 0. Unnested !! options parsoid=html2wt !! html/parsoid

=foo=

=foo= =foo=

=fooa=

!! wikitext =foo= =foo= =foo= =foo''a''= !!end # New headings and existing headings are handled differently !! test Headings: 1. Nested inside html !! options parsoid=html2wt !! html/parsoid

=foo=

=foo=

=foo=

=foo=

=foo=

=foo=

=foo=

=foo=
=foo=
!! wikitext = =foo= = == =foo= == === =foo= === ==foo== ===foo=== ====foo==== =====foo===== ======foo====== =======foo======= !! end !! test Headings: 2. Outside heading nest on a single line

foo

*bar !! options parsoid=html2wt !! html/parsoid

foo

*bar

foo

=bar

foo

=bar= !! wikitext = foo = *bar = foo = =bar = foo = =bar= !!end !! test Headings: 3. Nested inside html with wikitext split by html tags !! options parsoid=html2wt !! html/parsoid

=boldfoo=

!! wikitext = ='''bold'''foo= = !!end !! test Headings: 4a. No escaping needed (testing just h1 and h2) !! options parsoid=html2wt !! html/parsoid

=foo

foo=

=foo=

=foo= bar

=foo

foo=

=

=foo=

!! wikitext = =foo = = foo= = = =foo= = = =foo= bar = == =foo == == foo= == = = = = ''=''foo= = !!end !! test Headings: 4b. No escaping needed (inside p-tags) !! options parsoid=html2wt !! html/parsoid

=foo= x =foo=

!! wikitext =foo= x =foo= !! html/php

=foo= x =foo=

!!end !! test Headings: 4c. Short headings (1) !! options parsoid=html2wt !! html/parsoid

===

!! wikitext === !! html/php

===

!! end # in the html2wt direction we emit '= = =' or '===' !! test Headings: 4d. Short headings (2) !! options parsoid=wt2html,html2html !! wikitext = == === ==== ===== !! html/php

= ==

=[edit]

==[edit]

=[edit]

!! html/parsoid

= ==

=

==

=

!! end !! test Headings: 5. Empty headings !! options parsoid=html2wt !! html/parsoid

!! wikitext !! end !! test Headings: 6a. Heading chars in SOL context (with trailing spaces) !! options parsoid=html2wt !! html/parsoid

=a=

=a=

=a=

!! wikitext =a= =a= =a= !!end !! test Headings: 6b. Heading chars in SOL context (with trailing newlines) !! options parsoid=html2wt !! html/parsoid

=a= b

=a= b

=a= b

!! wikitext =a= b =a= b =a= b !!end !! test Headings: 6c. Heading chars in SOL context (leading newline break) !! options parsoid=html2wt !! html/parsoid

a =b=

!! wikitext a =b= !!end !! test Headings: 6d. Heading chars in SOL context (with interspersed comments) !! options parsoid=html2wt !! html/parsoid

=a=

=a=

!! wikitext =a= =a= !!end !! test Headings: 6d. Heading chars in SOL context (No escaping needed) !! options parsoid=html2wt !! html/parsoid =a=
b
!! wikitext =a=
b
!!end !! test Headings: 7. Insert a newline between new content and headings !! options parsoid=html2wt !! html/parsoid

NEW

new

A

a

!! wikitext == NEW == new ==A== a !! end !! test Headings: Used as horizontal rule !! config wgFragmentMode=[ "html5", "legacy" ] !! options parsoid=wt2html !! wikitext =============== !! html/php
===[edit]
!! html/parsoid
===
!! end #### --------------- Lists --------------- #### 0. Outside nests (*foo, etc.) #### 1. Nested inside html #### 2. Inside definition lists #### 3. Only bullets at start should be escaped #### 4. No escapes needed #### 5. No unnecessary escapes #### 6. Escape bullets in SOL position #### 7. Escape bullets in a multi-line context #### ---------------------------------------- !! test Lists: 0. Outside nests !! options parsoid=html2wt !! html/parsoid

*foo

#foo

;Foo:bar

!! wikitext *foo #foo ;Foo:bar !!end ## Making these next 3 tests Parsoid-only since they are html2wt tests ## to test wikitext escaping, and insignificant whitespace diffs ## cause PHP parser tests to barf !! test Lists: 1. Nested inside html (No unnecessary escapes) !! options parsoid=html2wt !! html/parsoid
  1. *foo
  2. #foo
  3. :foo
  4. ;foo
  5. *foo
  6. #foo
  7. :foo
  8. ;foo
!! wikitext * *foo * #foo * :foo * ;foo **foo *#foo *:foo *;foo # *foo # #foo # :foo # ;foo #*foo ##foo #:foo #;foo !!end !! test Lists: 2. Inside definition lists !! options parsoid=html2wt !! html/parsoid
;foo
:foo
:foo
bar
:foo
!! wikitext ; ;foo ; :foo ; :foo : bar : :foo !!end !! test Lists: 3. Only bullets at start of text in wikitext-generated HTML should be escaped !! options parsoid=html2wt !! html/parsoid !! wikitext * *foo*bar **foo''it''*bar !!end !! test Lists: 4. No escapes needed !! options parsoid=html2wt !! html/parsoid !! wikitext *foo*bar *''foo''*bar *[[Foo]]: bar *[[Foo]]*bar !!end !! test Lists: 5. No unnecessary escapes !! options parsoid=html2wt !! html/parsoid !! wikitext * bar [[foo]] * =bar [[foo]] * [[bar [[foo]] * ]]bar [[foo]] * =bar foo]]= * : a * ''* foo'' !!end !! test Lists: 6. Escape bullets in SOL position !! options parsoid=html2wt !! html/parsoid

*foo

!! wikitext *foo !!end !! test Lists: 7. Escape bullets in a multi-line context !! options parsoid=html2wt !! html/parsoid

a *b

!! wikitext a *b !!end !! test Lists: 8. Escape colons only if not present in tags !! options parsoid=html2wt !! html/parsoid
a:bc:d
!! wikitext ; a:b''c:d'' !! end #### --------------- HRs --------------- #### 1. Single line #### ----------------------------------- !! test HRs: 1. Single line !! options parsoid=html2wt !! html/parsoid
----
=foo=
*foo !! wikitext -------- ----=foo= ----*foo !! end #### --------------- Tables --------------- #### 1a. Simple example #### 1b. No escaping needed (!foo) #### 1c. No escaping needed (|foo) #### 1d. No escaping needed (|}foo) #### #### 2a. Nested in td (foo|bar) #### 2b. Nested in td (foo||bar) #### 2c. Nested in td -- no escaping needed(foo!!bar) #### #### 3a. Nested in th (foo!bar) #### 3b. Nested in th (foo!!bar) #### 3c. Nested in th -- no escaping needed(foo||bar) #### #### 4a. Escape - #### 4b. Escape + #### 4c. No escaping needed #### -------------------------------------- !! test Tables: 1a. Simple example !! options parsoid=html2wt !! html/parsoid

{| |}

!! wikitext {| |} !! end !! test Tables: 1b. No escaping needed !! options parsoid=html2wt !! html/parsoid

!foo

!! wikitext !foo !! end !! test Tables: 1c. No escaping needed !! options parsoid=html2wt !! html/parsoid

|foo

!! wikitext |foo !! end !! test Tables: 1d. No escaping needed !! options parsoid=html2wt !! html/parsoid

|}foo

!! wikitext |}foo !! end !! test Tables: 2a. Nested in td !! options parsoid=html2wt !! html/parsoid
foo|bar
x
a|b
!! wikitext {| |foo|bar |- |x
a|b
|} !! html/php
foo|bar
x
a|b
!! end !! test Tables: 2b. Nested in td !! options parsoid=html2wt !! html/parsoid
foo||bar ab||c a
b||c
!! wikitext {| |foo||bar |a''b||c'' |a''
b||c
'' |} !! html/php
foo||bar ab||c a
b||c
!! end !! test Tables: 2c. Nested in td -- no escaping needed !! options parsoid=html2wt !! html/*
foo!!bar
!! wikitext {| |foo!!bar |} !! end !! test Tables: 3a. Nested in th !! options parsoid=html2wt !! html/*
foo!bar
!! wikitext {| !foo!bar |} !! end !! test Tables: 3b. Nested in th !! options parsoid=html2wt !! html/parsoid
foo!!bar foo|bar foo!!bar foo!!bar
!! wikitext {| !foo!!bar !''foo|bar'' !''foo!!bar'' !''foo!!bar'' |} !! html/php
foo!!bar foo|bar foo!!bar foo!!bar
!! end !! test Tables: 3c. Nested in th !! options parsoid=html2wt !! html/parsoid
foo||bar foo||bar
!! wikitext {| !foo||bar !foo||bar |} !! html/php
foo||bar foo||bar
!! end !! test Tables: 4a. Escape - !! options parsoid=html2wt !! html/*
-bar
-bar
!! wikitext {| !-bar |- | -bar |} !! end !! test Tables: 4b. Escape + !! options parsoid=html2wt !! html/*
+bar
+bar
!! wikitext {| !+bar |- | +bar |} !! end !! test Tables: 4c. No escaping needed !! options parsoid=html2wt !! html/parsoid
foo-barfoo+bar
foo-barfoo+bar
foo

bar|baz +bar -bar

x
a|b
!! wikitext {| |foo-bar |foo+bar |- |''foo''-bar |''foo''+bar |- |foo bar|baz +bar -bar |- |x
a|b
|} !! html/php
foo-bar foo+bar
foo-bar foo+bar
foo

bar|baz +bar -bar

x
a|b
!! end ## FIXME: Looks like normalizing needs to learn about attrSepSrc !! test Tables: 4d. No escaping needed !! options parsoid=html2wt !! html/parsoid
Foo-bar +1 -2
!! wikitext {| |[[Foo]]-bar ||+1 ||-2 |} !! html/php
Foo-bar +1 -2
!! end !! test Tables: 4e. Escape } !! options parsoid=html2wt !! html/parsoid
}
x}
!! wikitext {| | } |- |x||} |} !! html/php
}
x }
!! end !! test Tables: 5. Empty table cells should get whitespace to avoid need for nowikis !! options parsoid=html2wt !! html/parsoid
!! wikitext {| | || align="center" | || |} {| | | align="center" | | |} {| | {{!}}{{!}} align="center" | || |} {| ! !! align="center" | !! |} !! html/php
!! end !! test T97430: Don't emit empty nowiki pairs around marker meta tags !! options parsoid=html2wt !! html/parsoid

*This is a long sentence here that will make the nowiki algo split up the nowikis into multiple pairs |** Make this another long long long sentence forcing the nowiki algo to split up the nowikis.

!! wikitext *This is a long sentence here that will make the nowiki algo split up the nowikis into multiple pairs |** Make this another long long long sentence forcing the nowiki algo to split up the nowikis. !! end !! test Unclosed xmlish element in table line shouldn't eat end delimiters !! options parsoid=html2wt !! html/parsoid
<foo bar>
!! wikitext {| | |} !! html/php
<foo bar>
!! end #### --------------- Links ---------------- #### 1. Quote marks in link text #### 2. Wikilinks: Escapes needed #### 3. Wikilinks: No escapes needed #### 4. Extlinks: Escapes needed #### 5. Extlinks: No escapes needed #### -------------------------------------- !! test Links 1. WikiLinks: No escapes needed !! options parsoid=html2wt !! html/parsoid

Fooboo [Foobar] x [Foobar] x

!! wikitext [[Foo|Foo''boo'']] [[Foo|[Foobar]]] [[Foo|x [Foobar] x]] !! html/php

Fooboo [Foobar] x [Foobar] x

!! end !! test Links 2. WikiLinks: Escapes needed !! options parsoid=html2wt !! html/parsoid Foobar] x [http://google.com g] x [[Bar]] x [[Bar]] x |Bar ]]bar [[bar x [[ y x ]] y x ]] y [[ z !! wikitext [[Foo|Foobar]]] [[Foo|x [http://google.com g] x]] [[Foo|[[Bar]]]] [[Foo|x [[Bar]] x]] [[Foo||Bar]] [[Foo|]]bar]] [[Foo|[[bar]] [[Foo|x [[ y]] [[Foo|x ]] y]] [[Foo|x ]] y [[ z]] !! html/php

Foobar] x [http://google.com g] x [[Bar]] x [[Bar]] x |Bar ]]bar [[bar x [[ y x ]] y x ]] y [[ z

!! end !! test Links 3. WikiLinks: No escapes needed !! options parsoid=html2wt !! html/parsoid

[Foobar foo|bar

!! wikitext [[Foo|[Foobar]] [[Foo|foo|bar]] !! html/php

[Foobar foo|bar

!! end !! test Links 4. ExtLinks: Escapes needed !! options parsoid=html2wt !! html/parsoid

[google] google] goog] le

[http://google.com]

[http://google.com google]

[http://google.com]

[http://google.com]

!! wikitext [http://google.com [google]] [http://google.com google]] [http://google.com goog] le] [http://google.com] [http://google.com google] [http://google.com] [{{1x|http://google.com}}] !! html/php

[google] google] goog] le

[http://google.com]

[http://google.com google]

[http://google.com]

[http://google.com]

!! end !! test Links 5. ExtLinks: No escapes needed !! options parsoid=html2wt !! html/parsoid

[google

[]

!! wikitext [http://google.com [google] [[http://google.com]] !! html/php

[google

[[1]]

!! end !! test Links 6. Add s between text-nodes and url-links when required (T66300) !! options parsoid=html2wt !! html/parsoid

xhttp://example.comy http://example.com?x http://example.com&x http://example.com'x http://example.com,x http://example.com.x http://example.com;x http://example.com:x http://example.com;x http://example.com!x http://example.com=x http://example.com(x) http://example.com(x)

!! wikitext xhttp://example.comy http://example.com?x http://example.com&x http://example.com'x http://example.com,x http://example.com.x http://example.com;x http://example.com:x http://example.com;x http://example.com!x http://example.com=x http://example.com(x) http://example.com(x) !! end !! test Links 7a. Don't add spurious s between text-nodes and url-links (T66300) !! options parsoid=html2wt !! html/parsoid

x http://example.com y "http://example.com" (http://example.com) (http://example.com) foo http://example.com, http://example.com, foo

!! wikitext x http://example.com y "http://example.com" (http://example.com) (http://example.com) foo http://example.com, http://example.com, foo !! html/php

x http://example.com y "http://example.com" (http://example.com) (http://example.com) foo http://example.com, http://example.com, foo

!! end !! test Links 7b. Don't add spurious s between text-nodes and url-links (T66300) !! options parsoid=html2wt !! html/parsoid

http://example.com.,;:!?\ -http://example.com:

!! wikitext http://example.com.,;:!?\ -http://example.com: !! html/php

http://example.com.,;:!?\ -http://example.com:

!! end !! test Links 8. Add s between text-nodes and RFC-links when required (T66300) !! options parsoid=html2wt !! html/parsoid

RFC 1234 RFC 123y XRFC 123y

!! wikitext RFC 1234 RFC 123y XRFC 123y !! end !! test Links 9. Don't add spurious s between text-nodes and RFC-links (T66300) !! options parsoid=html2wt !! html/parsoid

RFC 123?foo RFC 123&foo -RFC 123-

!! wikitext RFC 123?foo RFC 123&foo -RFC 123- !! html/php

RFC 123?foo RFC 123&foo -RFC 123-

!! end !! test Links 10. Add s between text-nodes and PMID-links when required (T66300) !! options parsoid=html2wt !! html/parsoid

PMID 1234 PMID 123y XPMID 123y !! wikitext PMID 1234 PMID 123y XPMID 123y !! end !! test Links 11. Don't add spurious s between text-nodes and PMID-links (T66300) !! options parsoid=html2wt !! html/parsoid

PMID 123?foo PMID 123&foo -PMID 123-

!! wikitext PMID 123?foo PMID 123&foo -PMID 123- !! html/php

PMID 123?foo PMID 123&foo -PMID 123-

!! end !! test Links 12. Add s between text-nodes and ISBN-links when required (T66300) !! options parsoid=html2wt !! html/parsoid

ISBN 12345678901 ISBN 1234567890x aISBN 1234567890b

!! wikitext ISBN 12345678901 ISBN 1234567890x aISBN 1234567890b !! end !! test Links 13. Don't add spurious s between text-nodes and ISBN-links (T66300) !! options parsoid=html2wt !! html/parsoid

-ISBN 1234567890's !! wikitext -ISBN 1234567890's !! html/php

-ISBN 1234567890's

!! end !! test Links 14. Protect link-like plain text. (Parsoid bug T78425) !! options parsoid=html2wt !! html/*

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

!! wikitext this is not a link: http://example.com !! end !! test Links 15. Link trails can't become link prefixes. !! options language=is parsoid=html2wt !! html/parsoid

Söfnuður-00

!! wikitext [[Söfnuður]]-[[00]] !! html/php

Söfnuður-00

!! end # This example actually from lnwiki, but arwiki has the same link # prefix and equivalent link trail for this purpose. !! test Links 17. Link trails (T236183) !! options language=ar !! wikitext [[Likalo]] · [[Pusupúsu]] · !! html/php

Likalo · Pusupúsu ·

!! html/parsoid

Likalo · Pusupúsu ·

!! end #### --------------- Quotes --------------- #### 1. Quotes inside and #### 2. Link fragments separated by and tags #### 3. Link fragments inside and #### 4. No escaping needed #### -------------------------------------- !! test 1a. Quotes inside and !! options parsoid=html2wt !! html/*

'foo' ''foo'' '''foo''' foo's 'foo' ''foo'' '''foo''' foo'bar'baz foo's 'foo foo' foo'' 'foo' 'foo foo' 'foo' fools' errand fool's errand 'foo bar 'baz a|!*#-:;+-~[]{}b'x

!! wikitext '''foo''' ''''foo'''' '''''foo''''' ''foo'''s ''''foo'''' '''''foo''''' ''''''foo'''''' '''foo'''bar'''baz''' '''foo''''s '''foo'' ''foo''' ''foo'''' '''foo''' ''''foo''' '''foo'''' ''''foo'''' ''fools' errand'' ''fool's errand'' '''foo'' bar '''baz'' a|!*#-:;+-~[]{}b'''x'' !! end !! test 1b. Quotes inside and with other tags on same line !! options parsoid=html2wt !! html/parsoid 'a foo bar a' foo bar a' foo bar foo x'bar 'foo [1] 'foo
test
'foo and
bar
  1. test
!! wikitext '''a'' foo ''[[bar]]'' ''a''' foo ''[[bar]]'' ''a''' foo '''{{1x|[[bar]]}}''' [[foo]] x'''[[bar]]'' '''foo'' test '''foo''
test
'''foo'' and
bar !! end !! test 2. Link fragments separated by and tags !! options parsoid=html2wt !! html/parsoid

[[foohello]]

[[foohello]]

!! wikitext [[''foo''hello]] [['''foo'''hello]] !! end # FIXME: Escaping one or both of [[ and ]] is also acceptable -- # this is one of the shortcomings of this format !! test 3. Link fragments inside and !! options parsoid=html2wt !! html/parsoid

[[foo]]

[[foo]]

!! wikitext ''[[foo'']] '''[[foo''']] !! end !! test 4. No escaping needed !! options parsoid=html2wt !! html/parsoid

'bar' 'bar' 'a:b'foo

!! wikitext '''bar''' ''''bar'''' 'a:b'foo !! end #### ----------- Paragraphs --------------- #### 1. No unnecessary escapes #### -------------------------------------- !! test 1. No unnecessary escapes !! options parsoid=html2wt !! html/parsoid

bar [[foo]]

=bar [[foo]]

[[bar [[foo]]

]]bar [[foo]]

=bar foo]]=

!! wikitext bar [[foo]] =bar [[foo]] [[bar [[foo]] ]]bar [[foo]] =bar foo]]= !!end #### ----------------------- PRE -------------------------- !! test 1. Leading whitespace in SOL context should be stripped !! options parsoid=html2wt !! html/parsoid

a

a

a(tab)

a a

a b

a b

a b

!! wikitext a a a(tab) a a a b a b a b !! html/php

a

a

a(tab)

a a

a b

a b

a b

!! end !! test 2. Leading whitespace in non-indent-pre contexts should not be escaped !! options parsoid=html2wt !! html/parsoid

foo [1]

  1. a b
!! wikitext foo ''a'' b !! end !! test 3. Leading whitespace in indent-pre suppressing contexts should not be escaped !! options parsoid=html2wt !! html/parsoid

a b c

!! wikitext
a b c
!! end !! test 4. Leading whitespace in indent-pre suppressing contexts should not be escaped !! options parsoid=html2wt !! html/parsoid
caption
!! wikitext [[File:Foobar.jpg|thumb|caption]] !! end !! test 5. Nowiki escaping should account for indent-pres !! options parsoid=html2wt !! html/parsoid
==foo==
!! wikitext ==foo== !! end !! test T95794: nowiki escaping should account for leading space at start-of-line in an indent-pre block !! options parsoid=html2wt !! html/parsoid
* foo
* bar
!! wikitext * foo * bar !! end !! test Whitespace scrubbing in SOL position should account for SOL-sensitive wikitext markup !! options parsoid = { "modes": ["html2wt"] } !! html/parsoid

foo

%foo

*foo

#foo

=foo=

*foo

*foo

*foo

*foo

foo

*foo

!! wikitext foo %foo *foo #foo =foo= [[Category:Foo]] *foo [[Category:Foo]] *foo *foo *foo foo *foo !! end #### --------------- Behavior Switches -------------------- !! test 1. Valid behavior switches should be escaped !! options parsoid=html2wt !! html/parsoid __TOC__ __TOC__ !! wikitext __TOC__ ''__TOC__'' !! end !! test 2. Invalid behavior switches should not be escaped !! options parsoid=html2wt !! html/parsoid __TOO__ __|__ !! wikitext __TOO__ __|__ !! end # We use indent-pre as an indirect way to test for sol-transparent behavior. !! test Behavior switches should be SOL-transparent !! options parsoid=html2wt !! html/parsoid
__TOO__
 foo
bar
!! wikitext __TOC__ __TOO__ __TOC__ foo __TOC__ bar !! end # last two tags test case-insensitivity !! test During serialization, normalize output when given a SOL-transparent prefix !! options parsoid=html2wt !! html/parsoid

x

y

z

p

!! wikitext x __NOTOC__y __NOTOC__z __notoc__p !! end #### --------------- HTML tags --------------- #### 1. a tags #### 2. other tags #### 3. multi-line html tag #### 4. extension tags #### ----------------------------------------- !! test 1. a tags !! options parsoid=html2wt !! html/parsoid <a href="http://google.com">google</a> !! wikitext google !! end !! test 2. other tags !! options parsoid=html2wt !! html/parsoid
  • <div>foo</div>
  • <div style="color:red">foo</div>
  • <td>
!! wikitext *
foo
*
foo
* !! end !! test 3. multi-line html tag !! options parsoid=html2wt !! html/parsoid

<div >foo</div >

!! wikitext
foo
!! end !! test 4. extension tags !! options parsoid=html2wt !! html/parsoid

<ref>foo</ref>

<ref>bar

baz</ref>

!! wikitext foo bar baz !! end ## FIXME: This test is less useful now that the leading space is normalized away !! test Parsoid: newline inducing block nodes don't suppress !! options parsoid=html2wt !! html/parsoid a

foo

!! wikitext a = foo = !! end #### --------------- Others --------------- !! test Escaping nowikis !! options parsoid=html2wt !! html/parsoid

<nowiki>foo</nowiki>

!! wikitext <nowiki>foo</nowiki> !! end ## The quote-char in the input is necessary for triggering the bug !! test (T54035) Nowiki-escaping should not get tripped by " :" in text !! options parsoid=html2wt !! html/parsoid

foo's bar :

!! wikitext foo's bar : !! end !! test Ensure that when a leading-whitespace-containing string is emitted on a newline, it is correctly escaped !! options parsoid={ "modes": ["selser"], "selser": "noauto", "changes": [ [ "div > p", "html", "DEF" ] ] } !! wikitext
ABC {{1x| {{{!}} {{!}} a {{!}}}}} b !! wikitext/edited
DEF {{1x| {{{!}} {{!}} a {{!}}}}} b !! end