# 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
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'' !! htmla b!! end !! test
withinside (compatibility with 1.6 and earlier) !! wikitext !! html <b> <cite> <em>!! end !! test Regression with preformatted in!! wikitext Blah !! html!! end !! test T54763: Preformatted in Blah!! wikitextBlah {| | indented cell (no pre-wrapping!) |}!! html!! end !!test Templates: Indent-Pre: 1a. Templates that break a line should suppressBlah
indented cell (no pre-wrapping!)
!! wikitext {{1x|}} !! html !! end !!test Templates: Indent-Pre: 1b. Templates that break a line should suppress!! wikitext {{1x| foo}} !! htmlfoo
!!end !! test Templates: Indent-Pre: 1c: Wrapping should be based on expanded content !! wikitext {{1x|a b}} !! htmlab
!!end !! test Templates: Indent-Pre: 1d: Wrapping should be based on expanded content !! wikitext {{1x|a b c d e }} !! htmlab c
de
!!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}} !! htmlfoofoo barfoo barfoofoobar!!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 !! htmla
a
ba
ba
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/parsoidX Y!! html/phpX Y!! end !! test Ensure DSR values for mw:DisplaySpace spans are computed correctly !! options parsoid=wt2html,selser !! wikitext x y :) !! html/parsoidx y :)!! html/phpx y :)!! end !! test pwrap test !! options parsoid=wt2html !! wikitext {{T1}}{{T1}} !! html/parsoidfoofoo!! end ### ### Parsoid-centric tests for testing RT edge cases for pre ### !!test 1a. Indent-Pre and Comments !! wikitext a c !! htmlac
!!end !!test 1b. Indent-Pre and Comments !! wikitext a c !! htmlac
!!end !!test 1c. Indent-Pre and Comments !! wikitext a a !! htmlaa!!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 !! htmlab!!end !!test 2a. Indent-Pre and tables !! wikitext {| |- !h1!!h2 |foo||bar |} !! html!!end !!test 2b. Indent-Pre and tables !! wikitext {| |- |foo |} !! html
h1 h2 foo bar !!end !!test 2c. Indent-Pre and tables (T44252) !! wikitext {| |+foo ! |bar |} !! html
foo !!end !!test 2d. Indent-Pre and tables !! wikitext a {| |b |} !! html/php
foo bar a!! html/parsoid
b a!!end !!test 2e. Indent-Pre and table-line syntax !! wikitext a | b | c !! html/php
b a | b | c!!end !!test 2f. Indent-pre started by table-line syntax !! wikitext a | b | c !! html/phpa
| b | c!! html/parsoida
| b | c!!end !! test 2g. Indented table markup mixed with indented pre content (proposed in T8200) !! wikitext!! 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
Text that should be rendered preformatted!! html/parsoid
foo bar baz bam!! end !! test 3a. Indent-Pre and block tags (single-line html) !! wikitext a
foo bar baz bamfoo
bfoocfoofoo !! html/phpa
foo
b
fooc
foo
foo
!! html/parsoida
foo
b
fooc
foo
foo
!! end !! test 3b. Indent-Pre and block tags (multi-line html) !! wikitext a foo bfoo!! html/parsoida foo
b
foo!! html/phpa foo
b
foo!! end !! test 3c. Indent-Pre and block tags (pre-content on separate line) !! wikitextfoo
foofoo foofoo
foo !! html/php
- foo
foo
foo foofoo
foo
foo!! html/parsoid
- foo
foo
foo foofoo
foo
foo!! end !! test 4. Indent-Pre and extension tags !! options parsoid=wt2html,html2html !! wikitext a
- foo
!! html/php a
NULL array ( )!! html/parsoida
NULL array ( )!! end !! test 5. Indent-Pre and html pre !! wikitexthi!! html/phphi!! html/parsoidhi!! end !! test Serializing indent pre at sol !! html/parsoidhi!! html/phphi!! wikitext hi !! end !!test Render paragraphs when indent-pre is suppressed in blocklevels !! wikitextfoo bar!! html!!end !!test 4. Multiple spaces at start-of-line !! wikitextfoo
bar
foo
foo {| |foo |} !! htmlfoo
foo!!end ## NOTE: the leading white-space chars on empty line are significant !! test 5a. White-space in indent-pre !! wikitext a
foo
b !! htmla!! end ## NOTE: the leading white-space chars on empty line are significant !! test 5b. White-space in indent-pre !! wikitext a b c !! html
ba b c!! end !! test 5c. White-space in indent-pre !! wikitext ''a'' ''b'' ''c'' !! htmla 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 !! htmla bcd
!! 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/parsoida b
!! end !! test Indent-Pre: Newlines in comments shouldn't affect sol state !! wikitext a b !! html/phpa b
!! html/parsoida 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!! html/php
- foo bar
!! html/parsoid
- foo bar
!! end
- foo bar