# 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 Template:1x !! text {{{1}}} !! endarticle !! article Template:T1 !! text
foo
!! endarticle !! test Preformatted text !! wikitext This is some Preformatted text With ''italic'' And '''bold''' And a [[Main Page|link]] !! html
This is some
Preformatted text
With italic
And bold
And a link
!! end !! test Tabs don't trigger preformatted text !! wikitext This is not preformatted text. This is preformatted text. So is this. !! html/php

This is not preformatted text.

This is preformatted text.
	So is this.
!! html/parsoid

This is not preformatted text.

This is preformatted text.
	So is this.
!! end ## FIXME: This test is less useful now that the leading space is normalized away !! test Space before tab needs nowiki pre protection !! options parsoid=html2wt !! html/parsoid

a

!! wikitext a !! end !! test Indent preformatting with inline content !! wikitext a ''b'' !! html
a
b
!! end !! test
 with  inside (compatibility with 1.6 and earlier)
!! wikitext




!! html
<b>
<cite>
<em>
!! end !! test Regression with preformatted in
!! wikitext
Blah
!! html
Blah
!! end !! test T54763: Preformatted in
!! wikitext
Blah {| | indented cell (no pre-wrapping!) |}
!! html

Blah

indented cell (no pre-wrapping!)

!! end !!test Templates: Indent-Pre: 1a. Templates that break a line should suppress
!! wikitext
 {{1x|}}
!! html
!! end

!!test
Templates: Indent-Pre: 1b. Templates that break a line should suppress 
!! wikitext
 {{1x|
foo}}
!! html

foo

!!end !! test Templates: Indent-Pre: 1c: Wrapping should be based on expanded content !! wikitext {{1x|a b}} !! html
a

b

!!end !! test Templates: Indent-Pre: 1d: Wrapping should be based on expanded content !! wikitext {{1x|a b c d e }} !! html
a

b c

d

e

!!end !!test Templates: Indent-Pre: 1e. Wrapping should be based on expanded content !! wikitext {{1x| foo}} {{1x| foo}}{{1x| bar}} {{1x| foo}} {{1x| bar}} {{1x| foo}} {{1x| foo}} {{1x|{{1x| }}bar}} !! html
foo
foo bar
foo
bar
foo
foo
bar
!!end !! test Templates: Indent-Pre: 1f: Wrapping should be based on expanded content !! wikitext {{1x| }}a {{1x| }}a {{1x| b}} {{1x|a }}b {{1x|a }} b !! html
a


a


b

a

b

a

b
!!end ### ### Parsoid-centric regression tests ### !! test Off-by-1 DSR values: Regression test for indent-pre usages !! options parsoid=wt2html,selser !! wikitext {{1x| }} ''{{1x| }} X'' {{1x| }} Y !! html/parsoid

X 
Y
!! html/php

X 
Y
!! end !! test Ensure DSR values for mw:DisplaySpace spans are computed correctly !! options parsoid=wt2html,selser !! wikitext x y :) !! html/parsoid
x
y :)
!! html/php
x
y :)
!! end !! test pwrap test !! options parsoid=wt2html !! wikitext {{T1}}{{T1}} !! html/parsoid
foo
foo
!! end ### ### Parsoid-centric tests for testing RT edge cases for pre ### !!test 1a. Indent-Pre and Comments !! wikitext a c !! html
a

c

!!end !!test 1b. Indent-Pre and Comments !! wikitext a c !! html
a

c

!!end !!test 1c. Indent-Pre and Comments !! wikitext a a !! html
 a
 a
!!end !!test 1d. Indent-Pre and Comments (Pre-handler currently cannot distinguish between comment/ws order and normalizes them to [comment,ws] order) !! wikitext a b !! html
a
b
!!end !!test 2a. Indent-Pre and tables !! wikitext {| |- !h1!!h2 |foo||bar |} !! html
h1 h2 foo bar
!!end !!test 2b. Indent-Pre and tables !! wikitext {| |- |foo |} !! html
foo
!!end !!test 2c. Indent-Pre and tables (T44252) !! wikitext {| |+foo ! |bar |} !! html
foo
bar
!!end !!test 2d. Indent-Pre and tables !! wikitext a {| |b |} !! html/php
a
b
!! html/parsoid
a
b
!!end !!test 2e. Indent-Pre and table-line syntax !! wikitext a | b | c !! html/php
a
| b
| c
!!end !!test 2f. Indent-pre started by table-line syntax !! wikitext a | b | c !! html/php

a

| b
| c
!! html/parsoid

a

| b
| c
!!end !! test 2g. Indented table markup mixed with indented pre content (proposed in T8200) !! wikitext
Text that should be rendered preformatted
!! html
Text that should be rendered preformatted
!! end !! test 2h. Indent pre in tables !! options parsoid=wt2html,html2html !! wikitext {| ! foo ! bar |- | baz {{!}} bam |} !! html/php
foo
bar
baz
bam
!! html/parsoid
foo
bar
baz
bam
!! end !! test 3a. Indent-Pre and block tags (single-line html) !! wikitext a

foo

b
foo
c
foo
foo !! html/php

a

foo

b

foo

c

foo

 foo 
!! html/parsoid

a

foo

b

foo

c

foo

 foo 
!! end !! test 3b. Indent-Pre and block tags (multi-line html) !! wikitext a foo b
foo
!! html/parsoid
a foo

b

foo
!! html/php
a foo

b

foo
!! end !! test 3c. Indent-Pre and block tags (pre-content on separate line) !! wikitext

foo

foo
foo
foo
foo
foo
  • foo
!! html/php

foo

foo
foo

foo

foo
foo
  • foo
!! html/parsoid

foo

foo
foo

foo

foo
foo
  • foo
!! end !! test 4. Indent-Pre and extension tags !! options parsoid=wt2html,html2html !! wikitext a !! html/php

a

NULL
array (
)
!! html/parsoid

a

NULL
array (
)
!! end !! test 5. Indent-Pre and html pre !! wikitext
hi
!! html/php
hi
!! html/parsoid
hi
!! end !! test Serializing indent pre at sol !! html/parsoid
hi
!! html/php
hi
!! wikitext hi !! end !!test Render paragraphs when indent-pre is suppressed in blocklevels !! wikitext
foo bar
!! html

foo

bar

!!end !!test 4. Multiple spaces at start-of-line !! wikitext

foo

foo {| |foo |} !! html

foo

   foo
foo
!!end ## NOTE: the leading white-space chars on empty line are significant !! test 5a. White-space in indent-pre !! wikitext a
b !! html
a
b
!! end ## NOTE: the leading white-space chars on empty line are significant !! test 5b. White-space in indent-pre !! wikitext a b c !! html
a

b


c
!! end !! test 5c. White-space in indent-pre !! wikitext ''a'' ''b'' ''c'' !! html
a
 b
  c
!! end !! test 6. Pre-blocks should extend across lines with leading WS even when there is no wrappable content !! wikitext a b c d !! html
a

b
c

d

!! end !! test 7a. Indent-pre and category links !! options parsoid=wt2html,wt2wt !! wikitext [[Category:foo]] {{1x| [[Category:foo]]}} !! html/php !! 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 7b. Indent-pre and category links !! options parsoid=wt2html !! wikitext [[Category:foo]] a [[Category:foo]] {{1x|b}} !! html/parsoid
 a
  b
!! end !! test Indent-Pre: Newlines in comments shouldn't affect sol state !! wikitext a b !! html/php

a b

!! html/parsoid

a b

!! end !! test Indent pre with leading colon !! wikitext :foo !! html/php
:foo
!! html/parsoid
:foo
!! end ## DO NOT DELETE trailing whitespace in the wikitext below! !! test Indent-Pre regression test: Trailing whitespace after sol-transparent content !! wikitext [[Category:Foo]] [[Category:Bar]] !! html/php !! html/parsoid !! end !! test Preserving leading whitespace in indent-pre suppressing contexts !! wikitext
  1. foo bar
!! html/php
  1. foo bar
!! html/parsoid
  1. foo bar
!! end