From: C. Scott Ananian foo
foo+
foo!!end !!test @@ -2156,7 +2156,7 @@ c !!end !!test -3c. Indent-Pre and block tags (multi-line html) +3b. Indent-Pre and block tags (multi-line html) !!input a foo b
foo
@@ -2231,6 +2231,78 @@ foo
!!end
+!!test
+4. Indent-Pre and extension tags
+!!input
+ a
| foo
+!! end + +!! test +Leading pipes outside of tables 2 +!! options +parsoid +!! input +a +| foo +b +!! result +a +| foo +b
+!! end + +!! test +Leading pipes outside of tables 3 +!! options +parsoid +!! input +a +| class="foo bar" | baz +b +!! result +a +| class="foo bar" | baz +b
+!! end + +!!test +Render paragraphs when indent-pre is suppressed in blocklevels +!!input ++ foo + + bar ++!! result +
++ +!!end + !!test 4. Multiple spaces at start-of-line !!input @@ -4153,9 +4225,9 @@ parsoid (http://example.com) !! result - + - + !! end ### @@ -5174,9 +5246,18 @@ Link with HTML entity in suffix / tail !! test Link with 3 brackets !! input -[[[main page]]] +[[[Main Page]]] +!! result +foo +
bar +
+
[[[Main Page]]] +
+!! end + +!! test +Link with 4 brackets +!! input +[[[[Main Page]]]] !! result -[[[main page]]] +
[[Main Page]]
!! end @@ -5599,6 +5680,36 @@ language=kaa !! end +!! test +1. Interaction of linktrail and template encapsulation +!! options +parsoid +!! input +{{echo|[[Foo]]}}l +!! result + +!! end + +!! test +2. Interaction of linktrail and template encapsulation +!! options +parsoid +!! input +{{echo|Some [[Fool]]}}s +!! result +Some Fools
+!! end + +!! test +3. Interaction of linktrail and template encapsulation +!! options +parsoid +!! input +{{echo|Some [[Fool]]s are '''bold and foolish'''}} +!! result +Some Fools are bold and foolish
+!! end + !! article Söfnuður !! text @@ -5687,7 +5798,7 @@ parsoid !! input [[Foo|{{echo|a}} b {{echo|c}}]] !! result - + !! end ### @@ -5746,10 +5857,9 @@ parsoid [[:en:Foo]] !! result - - + - + !! end !! test @@ -5771,6 +5881,15 @@ parsoid is just fragment !! end +!! test +Interwiki links: trail +!! options +parsoid +!! input +[[wikipedia:Foo|Ba]]r +!! result + +!! end ### ### Interlanguage links @@ -5856,10 +5975,9 @@ parsoid [[constructor:foo]] !! result - + - - + !! end !! test @@ -5883,11 +6001,21 @@ parsoid !! end +!! test +Parsoid: Bug #45209, handle interwiki links pointing to the current wiki as plain wiki links +!! options +parsoid +!! input +[[en:Foo]] +!! result + +!! end + ### ### Redirects, Parsoid-only ### !! test -Simple redirect to page +1. Simple redirect to page !! options parsoid !! input @@ -5896,6 +6024,19 @@ parsoid !! end +# Only wt2html and html2html since "Main_Page" will serialize to "Main Page" +!! test +2. Other redirect variants +!! options +parsoid=wt2html,wt2wt +!! input +#REDIRECT [[Main_Page]] +#REDIRECT [[Foo
+!! end + ## ## XHTML tidiness ### @@ -7513,6 +7665,39 @@ hi+world%3F%21 !! end +!! test +Magic Word: prioritize type info over data-parsoid +!! options +parsoid=html2wt +!! input +__FORCETOC__ +!! result + +!! end + +!! test +Magic Word: serialize on separate line (parsoid) +!! options +parsoid=wt2wt,html2wt +!! input +foo +__NOTOC__ +bar +!! result +foobar +!! end + +!! test +Magic Word: rt non-english wikis +!! options +parsoid=wt2wt +language=de +!! input +__NOEDITSECTION__ +!! result + +!! end + ### ### Magic links ### @@ -7583,6 +7768,27 @@ Template with invalid target containing unclosed tag !! end +!! test +Template with invalid target containing wikilink (php) +!! options +php +!! input +{{[[Main Page]]}} +!! result +{{Main Page}} +
+!! end + +!! test +Template with invalid target containing wikilink (parsoid) +!! options +parsoid +!! input +{{[[Main Page]]}} +!! result +{{Main Page}}
+!! end + !! article Template:test !! text @@ -8874,8 +9080,8 @@ parsoid[[]] +
+!! end + !! test Image with empty attribute (php) !! options @@ -9789,7 +10020,37 @@ parsoid=wt2html !! end !! test -Image with attributes from template (php) +1. Block image with individual attributes from templates +!! options +parsoid +!! input +[[File:Foobar.jpg|thumb|{{echo|137px}}|This is a caption]] +!! result + +!! end + +!! test +2. Block Image with individual attributes from templates +!! options +parsoid +!! input +[[File:Foobar.jpg|{{echo|thumb}}|{{echo|137px}}|This is a caption]] +!! result + +!! end + +!! test +3. Inline image with individual attributes from templates +!! options +parsoid +!! input +[[File:Foobar.jpg|{{echo|50px}}]] +!! result + +!! end + +!! test +Image with multiple attributes from the same template (php) !! options php !! input @@ -9799,14 +10060,16 @@ php !! end +## Parsoid does not provide editing support for images where templates produce multiple image attributes. +## To signal this, we add a 'mw:Placeholder' type to such images. This could change in the future. !! test -Image with attributes from template (parsoid) +Image with multiple attributes from the same template (parsoid) !! options parsoid !! input [[File:Foobar.jpg|{{image_attribs}}]] !! result - + !! end !! test @@ -9836,7 +10099,7 @@ parsoid !! result 123456 -123456 +123456 !! end !! test @@ -9860,6 +10123,54 @@ parsoid !! end +!! test +Image with multiple widths -- use last (php) +!! options +php +!! input +[[File:Foobar.jpg|200px|300px|caption]] +!! result + +!! end + +!! test +Image with multiple widths -- use last (parsoid) +!! options +parsoid +!! input +[[File:Foobar.jpg|200px|300px|caption]] +!! result + +!! end + +!! test +Image with multiple alignments -- use first (bug 48664) (php) +!! options +php +!! input +[[File:Foobar.jpg|thumb|left|right|center|caption]] + +[[File:Foobar.jpg|middle|text-top|caption]] +!! result + + +!! end + +!! test +Image with multiple alignments -- use first (bug 48664) (parsoid) +!! options +parsoid +!! input +[[File:Foobar.jpg|thumb|left|right|center|caption]] + +[[File:Foobar.jpg|middle|text-top|caption]] +!! result + + +!! end + !! test Image with width attribute at different positions (php) !! options @@ -9880,15 +10191,40 @@ Image with width attribute at different positions (parsoid) !! options parsoid !! input -[[File:Foobar.jpg|200px|right|Caption]] -[[File:Foobar.jpg|right|200px|Caption]] -[[File:Foobar.jpg|right|Caption|200px]] +[[File:Foobar.jpg|200x200px|right|Caption]] +[[File:Foobar.jpg|right|200x200px|Caption]] +[[File:Foobar.jpg|right|Caption|200x200px]] !! result !! end +# a sad bit of backward-compatibility +!! test +Image with size specified with pxpx (bug 13500, 51628) (php) +!! options +php +!! input +[[File:Foobar.jpg|20pxpx]] +[[File:Foobar.jpg|200x20pxpx]] +!! result + +!! end + +!! test +Image with size specified with pxpx (bug 13500, 51628) (parsoid) +!! options +parsoid=wt2html,wt2wt +!! input +[[File:Foobar.jpg|20pxpx]] +[[File:Foobar.jpg|200x20pxpx]] +!! result + +!! end + !! test Image with link parameter, wiki target (php) !! options @@ -10360,6 +10696,45 @@ Parsoid: Image caption containing leading space !!end +!! test +Image caption containing a table (php) +!! options +php +!! input +[[Image:Foobar.jpg|thumb|200px|This is an example image thumbnail caption with a table +{| +! Foo !! Bar +|- +| Foo1 || Bar1 +|} +and some more text.]] +!! result + + +!!end + +!! test +Image caption containing a table (parsoid) +!! options +parsoid +!! input +[[Image:Foobar.jpg|thumb|200px|This is an example image thumbnail caption with a table +{| +! Foo !! Bar +|- +| Foo1 || Bar1 +|} +and some more text.]] +!! result +Foo | Bar |
---|---|
Foo1 | +Bar1 |
-
+
@@ -10459,30 +10833,41 @@ parsoid
!! end
!! test
-Parsoid-specific image handling - simple image with both sizes, a baseline alignment, and a caption
+Parsoid-specific image handling - simple image with size, middle alignment,
+non-standard namespace alias
!! options
-parsoid
+parsoid=wt2wt,wt2html,html2html
!! input
-[[Image:Foobar.jpg|500x10px|baseline|caption]]
+[[Image:Foobar.jpg|middle|50px]]
!! result
-
-
+
!! end
!! test
-Parsoid-specific image handling - simple image with border and size spec
+Parsoid-specific image handling - simple image with size and middle alignment
+(existing content)
!! options
parsoid
!! input
-[[Image:Foobar.jpg|50px|border|caption]]
+[[File:Foobar.jpg|50px|middle]]
!! result
-
-
+
+!! end
+
+!! test
+Parsoid-specific image handling - simple image with size and middle alignment
+and non-standard namespace name
+!! options
+parsoid=wt2html,wt2wt,html2html
+!! input
+[[Image:Foobar.jpg|50px|middle]]
+!! result
+
@@ -10490,27 +10875,58 @@ parsoid
-
-
-
-
-
-#
-#
-#
-#
-#abc
-#
-#
+
+
+ bar A [1] A [1] A [1] B C A [1] B C B [1] B [1] C [2] C [2] a[1]
]]
-#!! result
-#a b c
]]
+!! result
+a b c
-
!!end
@@ -17142,11 +17626,11 @@ A foo B C
@@ -17291,9 +17775,9 @@ B bar
-
-
+
@@ -17370,20 +17854,49 @@ B
foo
!! result
-
+
-
+
-
-
+
!! end
+# This test is wt2html only because we're permitting the serializer to produce
+# dirty diffs, normalizing the unclosed references to the self-closed version.
+!! test
+Generate references for unclosed references tag
+!! options
+parsoid=wt2html
+!! input
+afoo
+
+
+
+!! end
+
+!! test
+New reference serializes on its own line
+!! options
+parsoid=wt2wt,html2wt
+!! input
+foo
+
+!! end
+
#### ----------------------------------------------------------------
#### The following section of tests are primarily to test
#### wikitext escaping capabilities of Parsoid. Given that
@@ -18111,6 +18624,21 @@ parsoid
!! end
+!! test
+Tables: Digest broken attributes on table and tr tag
+!! options
+parsoid=wt2html
+!! input
+{| || |} ++
+|- || || ++ --
+|}
+!! result
+
+
+
+!! end
+
#### --------------- Links ----------------
#### 1. Quote marks in link text
#### 2. Wikilinks: Escapes needed
@@ -18133,15 +18661,17 @@ Links 2. WikiLinks: Escapes needed
!! options
parsoid
!! input
-[[Foo|
+
!!end
+!!test
+2. Ensure fostered text content is wrapped in spans (traps regressions around fostered marker on the span getting lost)
+!!options
+parsoid=wt2html,wt2wt
+!!input
+
+
+!!result
+ || ||
+ || ||
+ a
+
+
+
+!!end
+
!!test
Encapsulation properly handles null DSR information from foster box
!!options
@@ -19023,14 +19573,24 @@ parsoid=wt2html,wt2wt
|}
!!result
-
+
-
+
+ a
+
-
+
!!end
+!!test
+Support