From f9de807e28c5194ef4e2ddbcf31375041816fab6 Mon Sep 17 00:00:00 2001
From: "C. Scott Ananian" {{ech
+o|foo}}
+ {{ech
+o|foo}} foo
+ foo
[http://example.com x +
[http://example.com x +
[[Foo +
{{echo|[[Foo}} +
+!! html/parsoid + + +[[Foo
+{{echo|[[Foo}}
+!! end + +!! test +Broken templates +!! options +parsoid=wt2html +!! wikitext +{{echo|[[Foo|}}]] + +[[Foo|{{echo|]]}} +!! html/php +{{echo|}} +
[[Foo|]] +
+!! html/parsoid +{{echo|}}
+[[Foo|]]
+!! end + !! test T4702: Mismatched , and tags are invalid !! wikitext @@ -7848,7 +7924,7 @@ File containing double quotes and spaces !! wikitext [[File:Cool "Gator".png]] !! html/parsoid - + !! end !! test @@ -7896,7 +7972,7 @@ Link with double quotes in title part (literal) and alternate part (interpreted) !! html/parsoid - + @@ -7916,10 +7992,10 @@ Broken image links with HTML captions (T41700) abc !! html/parsoid - + !! end !! test @@ -10435,15 +10511,26 @@ Parsoid: Page property magic word with magic word contents !! wikitext {{DISPLAYTITLE:''{{PAGENAME}}''}} !! html/parsoid - + !! end +# NOTE: mw:ExpandedAttrs is not the best typeof here. mw:Transclusion is better. +# But, this is a limitation of our representation and is documented in +# TemplateHandler.js in processSpecialMagicWord !! test Parsoid: Template-generated DISPLAYTITLE !! wikitext {{{{echo|DISPLAYTITLE}}:Foo}} +!! options +showtitle +!! config +wgAllowDisplayTitle=true +wgRestrictDisplayTitle=false +!! html/php +Foo + !! html/parsoid - + !! end !! test @@ -11006,6 +11093,39 @@ Template with complex template as argument !! end +!! test +Templates with templated name +!! wikitext +{{{{echo|echo}}|foo}} +{{{{echo|inner list}} }} +!! html +foo +
+foo
+{{echo +foo +}} +
+!! html/parsoid +{{echo +foo }}
+!! end + !! test Template with thumb image (with link in description) !! wikitext @@ -11021,7 +11141,7 @@ This is a test template with parameterThis is a test template with parameter
!! end !! article @@ -11253,17 +11373,23 @@ T2041: Template parameters shown as broken links !! test Template with targets containing wikilinks +!! options +parsoid=wt2html !! wikitext {{[[foo]]}} {{[[{{echo|foo}}]]}} {{{{echo|[[foo}}]]}} -!! html +!! html/php{{foo}}
{{foo}}
{{[[foo}}]]
+!! html/parsoid +{{foo}}
+{{foo}}
+{{[[foo}}]]
!! end !! article @@ -13112,6 +13238,17 @@ pst [[:Bar:Article (context)ï¼context|Article]] !! end +!! test +Parsoid: backwards pipe trick +!! wikitext +[[|'''bar''']] +!! html/php +[[|bar]] +
+!! html/parsoid +[[|bar]]
+!! end + !! test pre-save transform: trim trailing empty lines !! options @@ -14318,7 +14455,7 @@ Entities in file name and attributes !! html/parsoid - + !! end !! test @@ -14533,7 +14670,7 @@ wgEnableUploads=0 !! html/parsoid - + !! end # Parsoid-specific testing for images @@ -14866,6 +15003,7 @@ Render invalid page names as plain text (T53090) [[.]] [[..]] [[foo././bar]] +[[foo[http://example.com]xyz]] [[{{echo|./../foo}}|bar]] [[{{echo|foo/.}}|bar]] @@ -14889,6 +15027,7 @@ Render invalid page names as plain text (T53090) [[.]] [[..]] [[foo././bar]] +[[foo[1]xyz]][[./../foo|bar]] [[foo/.|bar]] [[foo/..|bar]] @@ -14911,7 +15050,8 @@ Render invalid page names as plain text (T53090) [[foo[bar]] [[.]] [[..]] -[[foo././bar]]
+[[foo././bar]] +[[fooxyz]][[./../foo|bar]]
[[foo/.|bar]]
@@ -15377,12 +15517,15 @@ Parsoid: Defaultsort
!! end
+# NOTE: mw:ExpandedAttrs is not the best typeof here. mw:Transclusion is better.
+# But, this is a limitation of our representation and is documented in
+# TemplateHandler.js in processSpecialMagicWord
!! test
Parsoid: Defaultsort (template-generated)
!! wikitext
{{{{echo|DEFAULTSORT}}:Foo}}
!! html/parsoid
-
+
!! end
###
@@ -16374,18 +16517,22 @@ Nesting of
Media link
!! wikitext
[[Media:Foobar.jpg]]
-!! html
+!! html/php
+!! html/parsoid
+
!! end
!! test
Media link with text
!! wikitext
[[Media:Foobar.jpg|A neat file to look at]]
-!! html
+!! html/php
+!! html/parsoid
+
!! end
# FIXME: this is still bad HTML tag nesting
@@ -16394,21 +16541,29 @@ Media link with text
Media link with nasty text
!! wikitext
[[Media:Foobar.jpg|Safe Link ]]
-!! html
+!! html/php
Safe Link<div style="display:none">" onmouseover="alert(document.cookie)" onfoo="</div>
-!! html+tidy
+!! html+php/tidy
+!! html/parsoid
+
+
!! end
!! test
Media link to nonexistent file (T3702)
!! wikitext
[[Media:No such.jpg]]
-!! html
+[[Media:No_such file.jpg]]
+!! html/php
Media:No such.jpg
+Media:No_such file.jpg
Media:No such.jpg
+Media:No_such file.jpg {{{|
-
- MOVE YOUR MOUSE CURSOR OVER THIS TEXT MOVE YOUR MOUSE CURSOR OVER THIS TEXT ISBN 123456789
ISBN 12345678901
ISBN 123456789 ISBN 12345678901 ISBN 1-234-56789-0 - 2006
ISBN 1 234 56789 0 - 2006
ISBN 1-234-56789-0 - 2006 ISBN 1 234 56789 0 - 2006 User:+% Page+title%
%+ %20 %+ %+r
-% +
+% +
3E 3E+ Quote [edit] Hanc marginis exiguitas non caperet.
QED
Hanc marginis exiguitas non caperet.
+QED Bar [edit] tag in TOC, removed by Sanitizer (T92892)
!! wikitext
__TOC__
== x ==
-!! html
+!! html/php
hiho
+}}}} >
+
@@ -17966,7 +18119,7 @@ Fuzz testing: image with bogus manual thumbnail
have a data-parsoid attribute set (even if
+# it's "{}").
+
!! test
T28375: TOC with italics
!! options
@@ -22227,7 +22398,7 @@ title=[[Main Page]]
!! wikitext
__TOC__
== ''Lost'' episodes ==
-!! html
+!! html/php
Contents
Lost episodes[edit]
+!! html/parsoid
+
+ Lost episodes
!! end
!! test
@@ -22245,7 +22419,7 @@ title=[[Main Page]]
!! wikitext
__TOC__
== '''should be bold''' then normal text ==
-!! html
+!! html/php
Contents
should be bold then normal text[edit]
+!! html/parsoid
+
+ should be bold then normal text
!! end
!! test
@@ -22263,7 +22440,7 @@ title=[[Main Page]]
!! wikitext
__TOC__
== Image [[Image:foobar.jpg]] ==
-!! html
+!! html/php
Contents
Image [edit]
+!! html/parsoid
+
+ Image
!! end
!! test
@@ -22281,7 +22461,7 @@ title=[[Main Page]]
!! wikitext
__TOC__
== Quote
==
-!! html
+!! html/php
Contents
-!! html+tidy
+!! html/php+tidy
Quote
[edit]
!! end
!! test
@@ -22317,7 +22500,7 @@ __TOC__
== Proof: 2 < 3 ==
Hanc marginis exiguitas non caperet.
QED
-!! html
+!! html/php
Quote
Contents
Proof: 2 < 3
+Bar
==
-!! html
+!! html/php
Contents
Foo Bar[edit]
Foo
-!! html+tidy
+!! html/php+tidy
Bar
[edit] Foo Bar
+ Foo
!! end
# Don't expect Parsoid to roundtrip this until the php parser comes closer to
@@ -22410,7 +22602,7 @@ __TOC__
== All attributes on these span tags must be deleted from the TOC ==
== Attributes after dir on these span tags must be deleted from the TOC ==
-!! html
+!! html/php
Bar
Contents
All attributes on these span tags must be deleted from the TOC[edit]
Attributes after dir on these span tags must be deleted from the TOC[edit]
+!! html/parsoid
+
+ C++
+ ××× ×!
+ The attributes on these span tags must be deleted from the TOC
+ All attributes on these span tags must be deleted from the TOC
+ Attributes after dir on these span tags must be deleted from the TOC
!! end
!! test
@@ -22434,7 +22633,7 @@ T74884: bdi element in ToC
!! wikitext
__TOC__
== test ==
-!! html
+!! html/php
Contents
test[edit]
+!! html/parsoid
+
+ test
!! end
!! test
@@ -22450,7 +22652,7 @@ T35715: s/strike element in ToC
!! wikitext
__TOC__
== test test test ==
-!! html
+!! html/php
Contents
test test test
+!! html/parsoid
+
+test test test[edit]
!! end
# Note that the html output does not have the , but the
@@ -22469,7 +22674,7 @@ Empty test test test Contents
x[edit]
-!! html+tidy
+!! html/php+tidy
x[edit]
+!! html/parsoid
+
+ x
!! end
!! article
@@ -26700,6 +26908,16 @@ parsoid=html2wt
[http://test.com][[one]] two three
!! end
+!! test
+Catch regression when unpacking misnested links
+!! options
+parsoid=wt2html
+!! wikitext
+{{echo|hi}}[http://example.com [[ho]]]
+!! html/parsoid
+