!! endarticle
+!! article
+Template:echo with depth
+!! text
+{{echo|{{{1}}}}}
+!! endarticle
+
!! article
Template:blank_param
!! text
@@ -237,7 +257,7 @@ Weirdo titles!
!!article
Template:Bullet
!!text
-* Bar
+*Bar
!!endarticle
!!article
@@ -307,23 +327,31 @@ This is a simple paragraph.
!! test
Paragraphs with extra newline spacing
!! wikitext
-foo
+a
-bar
+b (+2 nls)
-baz
+c (+3 nls)
+
+d (+4 nls)
-booz
+
+
+
+e (+5 nls)
!! html
-
foo
-
bar
+
a
+
b (+2 nls)
-baz
+c (+3 nls)
+
+
d (+4 nls)
-
booz
+
+e (+5 nls)
!! end
@@ -495,7 +523,6 @@ Extra newlines followed by heading
a
-
=b=
[[a]]
@@ -514,19 +541,89 @@ a
!! end
!! test
-Extra newlines between heading and content are swallowed
+Extra newlines between heading and content are swallowed (Parsoid does not)
!! wikitext
=b=
[[a]]
-!! html
+!! html/php+tidy
+!!end
+
!! test
Heading with line break in nowiki
!! options
@@ -1825,6 +1922,39 @@ b
!! end
+!! test
+post-expand include size being exceeded
+!! options
+maxincludesize=20
+!! wikitext
+{{echo3|1234567890}}
+!! html
+
+!! end
+
+!! test
+max template depth being reached
+!! options
+maxtemplatedepth=1
+!! wikitext
+{{echo with depth|too deep!}}
+!! html
+
Template recursion depth limit exceeded (1)
+
+!! end
+
+!! test
+multiple templates that are redirects
+!! wikitext
+{{redirect to foo}}
+{{redirect to foo}}
+!! html
+
FOO
+FOO
+
+!! end
+
!! test
Multiple comments should still parse as SOL-transparent
!! options
@@ -2142,6 +2272,83 @@ hi
!! end
+!! test
+Paragraph wrapping following unclosed table
+!! options
+parsoid=wt2html,html2html
+!! wikitext
+{|
+|-
+
+{|
+| x
+|}
+
+a
+
+b
+
+c
+!! html/php+tidy
+
+
+
+
+
+
x
+
+
a
+
b
+
c
+
+!! html/parsoid
+
+
+
+
+
x
+
+
+
a
+
+
b
+
+
c
+!! end
+
+!! test
+Paragraph wrapping suppressed in html p
+!! options
+parsoid=wt2html,html2html
+!! wikitext
+
+
+
+hi
+
+
+
+
+!! html/php+tidy
+
+
+
+hi
+
+
+
+
+!! html/parsoid
+
+
+
+hi
+
+
+
+
+!! end
+
###
### Preformatted text
###
@@ -2642,12 +2849,9 @@ parsoid=wt2html
x
<pre
!! html/parsoid
-
x
-
+
x
-
<pre
-
-
+<pre
!! end
!! test
@@ -3258,6 +3462,57 @@ a
!! 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
@@ -3285,24 +3540,24 @@ a
!! end
-!!test
+!! test
3b. Indent-Pre and block tags (multi-line html)
!! wikitext
a foo
- b
foo
-!! html
+ b
foo
+!! html/php
a foo
b
foo
!! html/parsoid
a foo
- b
foo
+
b
foo
!! html/php+tidy
a foo
b
foo
-!!end
+!! end
!!test
3c. Indent-Pre and block tags (pre-content on separate line)
@@ -3749,7 +4004,7 @@ Definition list with bracketed URL link
!! test
Definition list with wikilink containing colon
!! wikitext
-; [[Help:FAQ]]:The least-read page on Wikipedia
+;[[Help:FAQ]]:The least-read page on Wikipedia
!! html
@@ -3760,19 +4015,19 @@ Definition list with wikilink containing colon
!! test
Definition list with news link containing colon
!! wikitext
-;news:alt.wikipedia.rox: This isn't even a real newsgroup!
+;news:alt.wikipedia.rox :This isn't even a real newsgroup!
!! html/php
-
!! end
!! test
Malformed definition list with colon
!! wikitext
-; news:alt.wikipedia.rox -- don't crash or enter an infinite loop
+;news:alt.wikipedia.rox -- don't crash or enter an infinite loop
!! html
@@ -4004,6 +4259,8 @@ should be left alone
!! test
Definition Lists: Hacky use to indent tables, with comment before table
+!!options
+parsoid=wt2html
!! wikitext
::{|
|foo
@@ -4019,7 +4276,7 @@ Definition Lists: Hacky use to indent tables, with comment before table
!! test
Definition Lists: Hacky use to indent tables (WS-insensitive)
!! wikitext
-: {|
+:{|
|a
|}
!! html/php
@@ -4029,9 +4286,9 @@ Definition Lists: Hacky use to indent tables (WS-insensitive)
!! html/parsoid
-
+
a
-
+
!! end
## The PHP parser treats : items (dd) without a corresponding ; item (dt)
@@ -4967,7 +5224,7 @@ URL in text: [http://example.com http://example.com]
@@ -6032,7 +6289,7 @@ A table with nothing but a caption
A table with caption with default-spaced attributes and a table row
!! wikitext
{|
-|+ style="color: red;" | caption1
+|+ style="color: red;" |caption1
|-
|foo
|}
@@ -6316,8 +6573,8 @@ Accept "!!" in table data of mixed wikitext / html syntax
Accept empty attributes in td/th cells (td/th cells starting with leading ||)
!! wikitext
{|
-!| h1
-|| a
+!|h1
+||a
|}
!! html
@@ -6462,9 +6719,9 @@ Invalid attributes in table cell (T3830)
Table cell attributes: Pipes protected by nowikis should be treated as a plain character
!! wikitext
{|
-| title="foo" |bar
-| title="foo|" |bar
-| title="foo|" bar
+|title="foo" |bar
+|title="foo|" |bar
+|title="foo|" bar
|}
!! html/php
@@ -6536,7 +6793,7 @@ Element attributes with double ! should not be broken up by
style="color: red !important;" data-contrived="put this here
+
style="color: red !important;" data-contrived="put this here
foo
@@ -6646,8 +6903,8 @@ parsoid={
|}
!! wikitext/edited
{| boo style='border:1px solid black'
-| boo style='color:blue' |abc
-|boo style='color:blue'|xyz
+| boo style='color:blue' | abc
+|boo style='color:blue'| xyz
|}
!! end
@@ -6899,7 +7156,7 @@ b
Table cell with a single comment
!! wikitext
{|
-|
+|
|a
|}
!! html
@@ -7060,10 +7317,10 @@ a
a
!! html/parsoid
-
a
-
-
-
+
+a
+
+
!! end
!! test
@@ -7158,18 +7415,6 @@ parsoid=html2wt
'''quux'''
!! end
-!! test
-Parsoid: newline inducing block nodes don't suppress
-!! options
-parsoid=html2wt
-!! html/parsoid
- a
foo
-!! wikitext
-a
-
-= foo =
-!! end
-
!! test
Parsoid: Row-syntax table headings followed by comment & table cells
!! options
@@ -7191,8 +7436,8 @@ parsoid=wt2html,wt2wt
!! html/parsoid
-
foo
bar
-
baz
quux
+
foo
bar
+
baz
quux
!! end
@@ -7237,13 +7482,29 @@ parsoid=wt2html
!! end
-# T137406: Whitespace in the HTML
!! test
-1. Generate correct wikitext for tables with thead/tbody/tfoot
+Table with missing opening
tag
!! options
-parsoid=html2wt
-!! html/parsoid
-
+parsoid=wt2html,wt2wt
+!! wikitext
+
+
foo
+
+
+!! html+tidy
+
+
foo
+
+
+!! end
+
+# T137406: Whitespace in the HTML
+!! test
+1. Generate correct wikitext for tables with thead/tbody/tfoot
+!! options
+parsoid=html2wt
+!! html/parsoid
+
Test
@@ -7324,97 +7585,6 @@ parsoid=html2wt
|}
!! 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
-
X
a
-!! end
-
!! test
Wikitext tables can be nested inside HTML tables
!! options
@@ -7437,56 +7607,6 @@ parsoid=html2wt
!! end
-!! test
-Serialize wikitext list items as HTML list items when embedded in a HTML list
-!! options
-parsoid=html2wt
-!! html
-
-
a
-
b
-
-!! wikitext
-
-
a
-
b
-
-!! end
-
-# SSS FIXME: Is this actually a good thing given the
-# odd nested list output that is generated by MW?
-#
foo
..
instead of
-#
foo
..
-!! test
-Wikitext lists can be nested inside HTML lists
-!! options
-parsoid=html2wt
-!! html
-
!! end
+!! test
+Template parameter named "constructor"
+!! wikitext
+{{echo| constructor = |hi}}
+!! html/parsoid
+
hi
+!! end
+
!! article
ko:
!! text
@@ -9717,6 +9845,16 @@ 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
2. Lists with start-of-line-transparent tokens before bullets: Template close
!! wikitext
@@ -9920,7 +10058,7 @@ parsoid
!! test
Parsoid: Test of whitespace serialization with Templated bullets
!! options
-parsoid
+parsoid=wt2html
!! wikitext
* {{bullet}}
!! html/parsoid
@@ -10040,22 +10178,6 @@ parsoid=wt2html,wt2wt,html2html
!!end
-!! test
-Table with missing opening
tag
-!! options
-parsoid=wt2html,wt2wt
-!! wikitext
-
-
foo
-
-
-!! html+tidy
-
-
foo
-
-
-!! end
-
###
### Magic Words
###
@@ -10909,7 +11031,7 @@ RFC 822
!! end
@@ -11504,6 +11626,17 @@ Template from main namespace
!! end
+!! test
+Template from non-includable namespace
+!! options
+wgNonincludableNamespaces=10
+!! wikitext
+{{echo|uh oh!}}
+!! html
+
+!! end
+
!! article
Template:table
!! text
@@ -12730,16 +12863,22 @@ Templates: Block Tags: 2. Back-to-back template uses
!!end
-# This is an edge case relating to paragraph wrapping.
-!!test
+## This is an edge case relating to paragraph wrapping.
+## Note that Parsoid fails to match Remex because it's using the closing tag
+## as a heuristic to determine if it's in a block, rather than SAX based events.
+!! test
Templates: Correctly encapsulate templates producing tag without a corresponding
tag
!! wikitext
{{echo|a
b
}}
+!! html/php+tidy
+
a
+
+b
!! html/parsoid
-
a
-b
-!!end
+
a
+b
+!! end
!!test
Templates: Links: 1. Simple example
@@ -12920,6 +13059,24 @@ Templates: Support for templates generating attributes and content
!!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
+
!! test
1. Entities and nowikis inside templated attributes should be handled correctly
!! wikitext
@@ -13090,13 +13247,13 @@ parsoid=wt2html,wt2wt
foo
!!end
-!!test
+!! test
Templates: Wiki Tables: 1a. Fostering of entire template content
!! wikitext
{|
{{echo|a}}
|}
-!! html
+!! html/php
a
@@ -13106,7 +13263,7 @@ a
a
!! html/parsoid
-
a
+a
!! end
@@ -13142,14 +13299,14 @@ foo
!! end
-!!test
+!! test
Templates: Wiki Tables: 2. Fostering of partial template content
!! wikitext
{|
{{echo|a
b
}}
|}
-!! html
+!! html/php
a
b
@@ -13161,7 +13318,7 @@ a
b
!! html/parsoid
-
a
b
+a
b
@@ -13407,6 +13564,19 @@ Parser Functions: 2. Nested use (only outermost should be marked up)
!!end
+## Note that the templates inside the references are not wrapped
+!! test
+Template nested in extension tag in template
+!! wikitext
+{{echo|hi[[ho|{{echo|hi}}]]}}
+{{echo|hi[http://test.com?q={{echo|ho}}]}}
+
+!! html/parsoid
+
+
+!! html/parsoid
+
+!! end
+
###################
# Conflicting image format options.
# First option specified should 'win'.
@@ -15063,7 +15252,7 @@ T3887: A RFC with a thumbnail
!! html/parsoid
-
+
!! end
!! test
@@ -15400,8 +15589,7 @@ Parsoid-specific image handling - simple image with size and middle alignment
!! end
!! test
-Parsoid-specific image handling - simple image with size, middle alignment,
-non-standard namespace alias
+Parsoid-specific image handling - simple image with size, middle alignment, non-standard namespace alias
!! options
parsoid=wt2wt,wt2html,html2html
!! wikitext
@@ -15411,8 +15599,7 @@ parsoid=wt2wt,wt2html,html2html
!! end
!! test
-Parsoid-specific image handling - simple image with size and middle alignment
-(existing content)
+Parsoid-specific image handling - simple image with size and middle alignment (existing content)
!! wikitext
[[File:Foobar.jpg|50px|middle]]
!! html/parsoid
@@ -15420,8 +15607,7 @@ Parsoid-specific image handling - simple image with size and middle alignment
!! end
!! test
-Parsoid-specific image handling - simple image with size and middle alignment
-and non-standard namespace name
+Parsoid-specific image handling - simple image with size and middle alignment and non-standard namespace name
!! options
parsoid=wt2html,wt2wt,html2html
!! wikitext
@@ -15448,41 +15634,46 @@ Parsoid-specific image handling - simple image with border and size spec
!! test
Parsoid-specific image handling - thumbnail with halign, valign, and caption
+!! options
+parsoid=wt2html,html2html
!! wikitext
[[File:Foobar.jpg|left|baseline|thumb|caption content]]
!! html/parsoid
-
+
!! end
!! test
-Parsoid-specific image handling - thumbnail with halign, valign, and caption
-(existing content)
+Parsoid-specific image handling - thumbnail with halign, valign, and caption (existing content)
+!! options
+parsoid=wt2html,html2html
!! wikitext
[[File:Foobar.jpg|thumb|left|baseline|caption content]]
!! html/parsoid
-
+
!! end
!! test
Parsoid-specific image handling - thumbnail with specific size, halign, valign, and caption
+!! options
+parsoid=wt2html,html2html
!! wikitext
[[Image:Foobar.jpg|right|middle|thumb|50x50px|caption]]
!! html/parsoid
-
+
!! end
!! test
-Parsoid-specific image handling - thumbnail with specific size, halign,
-valign, and caption (existing content)
+Parsoid-specific image handling - thumbnail with specific size, halign, valign, and caption (existing content)
+!! options
+parsoid=wt2html,html2html
!! wikitext
[[File:Foobar.jpg|thumb|50x50px|right|middle|caption]]
!! html/parsoid
-
+
!! end
!! test
-Parsoid-specific image handling - framed image with specific size and caption
-(size is ignored)
+Parsoid-specific image handling - framed image with specific size and caption (size is ignored)
!! options
parsoid=wt2html,wt2wt,html2html
!! wikitext
@@ -15492,14 +15683,13 @@ parsoid=wt2html,wt2wt,html2html
!! end
!! test
-Parsoid-specific image handling - framed image with specific size, halign, valign, and caption
-(size is ignored)
+Parsoid-specific image handling - framed image with specific size, halign, valign, and caption (size is ignored)
!! options
-parsoid=wt2html,wt2wt,html2html
+parsoid=wt2html,html2html
!! wikitext
[[File:Foobar.jpg|left|baseline|frame|500x50px|caption]]
!! html/parsoid
-
+
!! end
!! test
@@ -16042,33 +16232,49 @@ parsoid=wt2html
!! test
3. Categories and newlines: newline suppression for last list item should RT properly
!! wikitext
-* a
-* b
+*a
+*b
[[Category:Foo]]
[[Category:Bar]]
[[Category:Baz]]
+
+:c
+
+[[Category:C]]
+
+;d
+
+[[Category:D]]
!! html/parsoid
-
a
-
b
+
a
+
b
-
+
-
-
+
+
+
+
c
+
+
+
+
d
+
+
!! end
!! test
4. Categories and newlines: newline suppression for last list item should RT properly
!! wikitext
-* a
-**** b
+*a
+****b
[[Category:Foo]]
!! html/parsoid
-
a
-
b
+
a
+
b
!! end
@@ -16079,18 +16285,18 @@ parsoid=wt2html
!! options
parsoid=wt2html
!! wikitext
-* a
-** b
+*a
+**b
[[Category:Foo]]
-* c
-** d
+*c
+**d
[[Category:Foo]]
!! html/parsoid
-
a
-
b
+
a
+
b
-
c
-
d
+
c
+
d
!! end
@@ -16103,9 +16309,9 @@ parsoid=wt2html
!! options
parsoid=wt2html
!! wikitext
-* a [[Category:Foo]]
+*a [[Category:Foo]]
!! html/parsoid
-
a
+
a
!! end
# This test also demonstrates because of newline+category tunneling
@@ -16114,23 +16320,23 @@ parsoid=wt2html
!! test
7. Categories and newlines: migrateTrailingCategories dom pass should leave template content alone
!! wikitext
-* {{echo|a
+*{{echo|a
[[Category:Foo]]}}
!! html/parsoid
-
a
+
a
!! end
!! test
8. Categories and newlines: migrateTrailingCategories dom pass should not get tripped by intervening templates
!! wikitext
-* a
+*a
{{echo|[[Category:Foo]]
[[Category:Bar]]}}
[[Category:Baz]]
!! html/parsoid
-
a
+
a
@@ -16138,7 +16344,21 @@ parsoid=wt2html
!! end
!! test
-9. Categories and newlines: should behave properly with linkprefix (T87753)
+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
@@ -16158,7 +16378,7 @@ foo bar
!! end
!! test
-10. No regressions on internal links following category (T174639)
+No regressions on internal links following category (T174639)
!! options
parsoid=wt2html,html2html
!! wikitext
@@ -18621,7 +18841,7 @@ Punctuation: CSS !important (T13874)
!! wikitext
important
!! html
-
important
+
important
!!end
@@ -18630,7 +18850,7 @@ Punctuation: CSS ! important (T13874; with space after)
!! wikitext
important
!! html
-
important
+
important
!!end
@@ -20946,6 +21166,25 @@ File:Foobar.jpg
!! end
+!! test
+Serialize gallery image captions on a line
+!! options
+parsoid={
+ "modes": ["html2wt"],
+ "nativeGallery": true
+}
+!! html/parsoid
+
+
hi
ho
+
hi ho
+
+!! wikitext
+
+File:Foobar.jpg| hi ho
+File:Foobar.jpg|hi ho
+
+!! end
+
!! test
HTML Hex character encoding (spells the word "JavaScript")
!! options
@@ -21105,18 +21344,22 @@ T24905: followed by ISBN followed by
Double RFC
!! wikitext
RFC RFC 1234
-!! html
+!! html/php
!! html/parsoid
@@ -23255,7 +23498,12 @@ Line two
!! end
-# FIXME: Why does/should the blockquote+div combo suppress p-wrapping here?
+## 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
@@ -23890,10 +24138,10 @@ Play a bit with r67090 and T5158
!! html/php
-
+
-
+
!! html/parsoid
Â
@@ -23903,6 +24151,15 @@ Play a bit with r67090 and T5158
!! end
+!! test
+T5158: Test for French spaces in attributes
+!! wikitext
+
+!! html/php
+
+
+!! end
+
!! test
HTML5 data attributes
!! wikitext
@@ -24585,6 +24842,17 @@ 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
@@ -24806,9 +25074,9 @@ Empty LI and TR nodes should be stripped from template content
!! test
Empty LI and TR nodes should not be stripped from top-level content
!! wikitext
-* a
+*a
*
-* b
+*b
{|
|-
@@ -24817,9 +25085,9 @@ Empty LI and TR nodes should not be stripped from top-level content
|}
!! html/parsoid
-
a
+
a
-
b
+
b
@@ -25736,6 +26004,65 @@ parsoid=html2wt
!! end
+!! test
+Tables: 5. Empty table cells should get whitespace to avoid need for nowikis
+!! options
+parsoid=html2wt
+!! html/parsoid
+
+!! end
+
!! test
T97430: Don't emit empty nowiki pairs around marker meta tags
!! options
@@ -26265,8 +26592,6 @@ bar [[foo]]
!!end
#### ----------------------- PRE --------------------------
-#### 1. Leading whitespace in SOL context should be escaped
-#### ------------------------------------------------------
!! test
1. Leading whitespace in SOL context should be escaped
!! options
@@ -26379,7 +26704,7 @@ parsoid=html2wt
==foo==
!! end
-!!test
+!! test
T95794: nowiki escaping should account for leading space at start-of-line in an indent-pre block
!! options
parsoid=html2wt
@@ -26393,6 +26718,51 @@ parsoid=html2wt
* bar
!! end
+!! test
+Whitespace scrubbing in SOL position should account for SOL-sensitive wikitext markup
+!! options
+parsoid = {
+ "modes": ["html2wt"],
+ "scrubWikitext": true
+}
+!! html/parsoid
+
!!end
@@ -26982,64 +27364,64 @@ plain text
plain text
!!end
-!!test
+!! test
1. Ensure fostered text content is wrapped in element nodes
-!!options
+!! options
parsoid=wt2html
!! wikitext
hi
ho
+!! html/php+tidy
+hi
ho
!! html/parsoid
-
hi
-
-
ho
-
-!!end
+hi
ho
+!! end
-!!test
+!! test
2. Ensure fostered text content is wrapped in element nodes (traps regressions around fostered marker on the element getting lost)
-!!options
+!! options
parsoid=wt2html,wt2wt
!! wikitext
|| ||
a
+!! html/php+tidy
+ || ||
+
+
a
+
!! html/parsoid
-
|| ||
-
-
a
-
-!!end
+ || ||
+
+
a
+
+!! end
-!!test
+!! test
Encapsulation properly handles null DSR information from foster box
-!!options
+!! options
parsoid=wt2html,wt2wt
!! wikitext
{{echo|
foo
bar
}}
!! html/parsoid
foo
bar
-!!end
+!! end
-!!test
+!! test
1. Encapsulate foster-parented transclusion content
-!!options
+!! options
parsoid=wt2wt,wt2html
!! wikitext
{{echo|foo
bar
}}
+!! html/php+tidy
+foo
bar
!! html/parsoid
-
foo
-
-
-
bar
-
-
-
-!!end
+foo
bar
+!! end
-!!test
+!! test
2. Encapsulate foster-parented transclusion content
-!!options
+!! options
parsoid=wt2wt,wt2html
!! wikitext
{{echo|foo}}
bar
@@ -27052,11 +27434,11 @@ parsoid=wt2wt,wt2html
-!!end
+!! end
-!!test
+!! test
3. Encapsulate foster-parented transclusion content
-!!options
+!! options
parsoid=wt2wt,wt2html
!! wikitext
{{echo|foo
}}bar
@@ -27071,11 +27453,11 @@ parsoid=wt2wt,wt2html
-!!end
+!! end
-!!test
+!! test
4. Encapsulate foster-parented transclusion content
-!!options
+!! options
parsoid=wt2wt,wt2html
!! wikitext
{{echo|foo
}}bar
@@ -27090,52 +27472,33 @@ parsoid=wt2wt,wt2html
-!!end
+!! end
-!!test
+!! test
5. Encapsulate foster-parented transclusion content
!!options
parsoid=wt2wt,wt2html
!! wikitext
{{echo|foo
foo}}
+!! html/php+tidy
+foo
foo
!! html/parsoid
-
foo
-
-
-
-
-
-
foo
-
-
-
-
-
-!!end
+foo
foo
+!! end
-!!test
+!! test
6. Encapsulate foster-parented transclusion content
-!!options
+!! options
parsoid=wt2wt,wt2html
!! wikitext
{{echo|foo
foo
}}
ok
+!! html/php+tidy
+foo
foo
ok
!! html/parsoid
-
foo
-
-
-
-
-
-
foo
-
-
-
-
-
-
ok
-!!end
+foo
foo
ok
+!! end
-!!test
+!! test
7. Encapsulate foster-parented transclusion content
!!options
parsoid=wt2wt,wt2html
@@ -27150,13 +27513,13 @@ parsoid=wt2wt,wt2html
-!!end
+!! end
# Note that the wt is broken on purpose: the = should be {{=}} if you
# don't want it to be a template parameter key.
-!!test
+!! test
8. Encapsulate foster-parented transclusion content
-!!options
+!! options
parsoid=wt2wt,wt2html
!! wikitext
{{echo|a
@@ -27164,30 +27527,36 @@ parsoid=wt2wt,wt2html
|-
|b
|}
-!! html/parsoid
-
a
-
-
{{{1}}}
+!! html/php+tidy
+
a
+
-
-
-
b
-
-
-
-!!end
-!!test
+
+
b
+
+!! html/parsoid
+
a
+{{{1}}}
+
+
b
+
+!! end
+
+!! test
9. Encapsulate foster-parented transclusion content
!!options
parsoid=wt2wt,wt2html
!! wikitext
{{echo|hi
hello}}
+!! html/php+tidy
+hi
hello
+
!! html/parsoid
-
hi
hello
-!!end
+hi
hello
+!! end
-!!test
+!! test
Table in fosterable position
!!options
parsoid=wt2html
@@ -27205,7 +27574,7 @@ parsoid=wt2html
-!!end
+!! end
# Parsoid only for T66747
!! test
@@ -27850,7 +28219,7 @@ parsoid={
== hi pal ==
- [[Category:A3]]
+[[Category:A3]]
== how goes it ==
@@ -28174,7 +28543,7 @@ parsoid={
!! html/parsoid
Football
!! wikitext
-[[Football|''Football'']]
+''[[Football]]''
!! end
!! test
@@ -28190,6 +28559,98 @@ parsoid={
[[Football|Foot]][[Football|ball]]
!! end
+!! test
+1. Move format tags outside of WikiLink
+!! options
+parsoid={
+ "modes": ["html2wt"],
+ "scrubWikitext": true
+}
+!! 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"],
+ "scrubWikitext": true
+}
+!! html/parsoid
+Football
+!! wikitext
+'''''[[Football]]'''''
+!! end
+
+!! test
+3. Move format tags outside of WikiLink while preserving formats already outside WikiLink
+!! options
+parsoid={
+ "modes": ["html2wt"],
+ "scrubWikitext": true
+}
+!! 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"],
+ "scrubWikitext": true
+}
+!! html/parsoid
+Foo
+Foo>
+Foo
+!! wikitext
+[[Foo|Foo]]
+[[Foo|Foo>]]
+[[Foo|Foo]]
+!! end
+
+!! test
+5. T194083 Regression test: Manual edit test that also enables scrubWikitext to move format tags outside wikilinks
+!! options
+parsoid={
+ "modes": ["selser"],
+ "scrubWikitext": true,
+ "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"],
+ "scrubWikitext": true,
+ "changes": [
+ ["i", "wrap", ""]
+ ]
+}
+!! wikitext
+''Foo''
+!! wikitext/edited
+''[[Foo]]''
+!! end
+
#------------------------------
# End of tag minimization tests
#------------------------------
@@ -28429,8 +28890,8 @@ Magic links inside image captions (autolinked)
!! 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
+
X
a
+!! end
+
+!! test
+Serialize wikitext list items as HTML list items when embedded in a HTML list
+!! options
+parsoid=html2wt
+!! html
+
+
a
+
b
+
+!! wikitext
+
+
a
+
b
+
+!! end
+
+# SSS FIXME: Is this actually a good thing given the
+# odd nested list output that is generated by MW?
+#
foo
..
instead of
+#
foo
..
+!! test
+Wikitext lists can be nested inside HTML lists
+!! options
+parsoid=html2wt
+!! html
+
+
a
+
b
+
+
+
+
+
x
+
y
+
+
+!! wikitext
+
+
a
+* b
+
+
+
+
+
x
+* y
+
+
+!! end
+
!! test
WTS change modes
!! options
@@ -28880,7 +29479,7 @@ parsoid={
!! html/parsoid
ok
!! wikitext
- [[Category:A2]]
+[[Category:A2]]
== ok ==
!! end
@@ -28948,7 +29547,7 @@ parsoid={
!! html/parsoid
foo bar
!! wikitext
-== foo bar ==
+== foo bar ==
!! end
!! test
@@ -30623,10 +31222,16 @@ 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 ==
+== Tabs ==
+== ÐиÑÐ½Ð°Ñ Ð¶Ð¸Ð·Ð½Ñ ==
* List item
; term : definition
{|
@@ -30646,6 +31251,7 @@ __NOTOC__
!! html/php+tidy
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
@@ -30692,10 +31324,23 @@ __NOTOC__
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 ]]
@@ -30703,6 +31348,9 @@ foo '' italic '' and ''' bold '''