X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fparser%2FparserTests.txt;h=c8c63f397b39344b2b64e5f81f847ef373d7d529;hp=f70a1b0de0cc65da5a56b71787adbdc53e16be19;hb=ee734d0d3c7533bd9a690dbd71f5151da55c32ad;hpb=355fdffe3eb08838e56909f7c36f6bff786c8b94 diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index f70a1b0de0..c8c63f397b 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -2057,13 +2057,28 @@ Tabs don't trigger preformatted text preformatted text. This is preformatted text. So is this. -!! html +!! 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 + +!! test +Space before tab needs nowiki pre protection +!! options +parsoid=html2wt +!! html/parsoid +

a

+!! wikitext + a !! end !! test @@ -5234,38 +5249,6 @@ External link containing a single quote. (bug 63947)

bang

!! end - -!! test -External link containing a period in the anchor. (bug 63947) -!! wikitext -[//foo.org/bar#baz. bang] - -[//foo.org/bar. bang] -!! html/php -

bang -

bang -

-!! html/parsoid -

bang

-

bang

-!! end - -!! test -External link containing a single quote. (bug 63947) -!! wikitext -[//foo.org/bar'baz] - -[//foo.org/bar'baz bang] -!! html/php -

[1] -

bang -

-!! html/parsoid -

-

bang

-!! end - - !! test External link containing double-single-quotes in text '' (bug 4598 sanity check) !! wikitext @@ -5301,9 +5284,22 @@ External link containing double-single-quotes with no space separating the url f External link with comments in link text !! wikitext [http://www.google.com Google ] -!! html +!! html/php

Google

+!! html/parsoid +

Google

+!! end + +!! test +External link to bare IPv4 address +!! wikitext +[http://192.168.0.1 Link] +!! html/php +

Link +

+!! html/parsoid +

Link

!! end !! test @@ -5345,7 +5341,7 @@ IPv6 urls, autolink format (T23261) !! wikitext http://[2404:130:0:1000::187:2]/index.php -Examples from RFC2373, section 2.2: +Examples from RFC 2373, section 2.2: * http://[1080::8:800:200C:417A]/unicast * http://[FF01::101]/multicast * http://[::1]/loopback @@ -5362,9 +5358,9 @@ Examples from RFC 2732, section 2: * http://[::FFFF:129.144.52.38]:80/index.html * http://[2010:836B:4179::836B:4179] -!! html +!! html/php

http://[2404:130:0:1000::187:2]/index.php -

Examples from RFC2373, section 2.2: +

Examples from RFC 2373, section 2.2:

+!! html/parsoid +

http://[2404:130:0:1000::187:2]/index.php

+ +

Examples from RFC 2373, section 2.2:

+ + +

Examples from RFC 2732, section 2:

+ !! end !! test @@ -5389,7 +5404,7 @@ IPv6 urls, bracketed format (T23261) !! wikitext [http://[2404:130:0:1000::187:2]/index.php test] -Examples from RFC2373, section 2.2: +Examples from RFC 2373, section 2.2: * [http://[1080::8:800:200C:417A] unicast] * [http://[FF01::101] multicast] * [http://[::1]/ loopback] @@ -5406,9 +5421,9 @@ Examples from RFC 2732, section 2: * [http://[::FFFF:129.144.52.38]:80/index.html 6] * [http://[2010:836B:4179::836B:4179] 7] -!! html +!! html/php

test -

Examples from RFC2373, section 2.2: +

Examples from RFC 2373, section 2.2:

+!! html/parsoid +

test

+ +

Examples from RFC 2373, section 2.2:

+ + +

Examples from RFC 2732, section 2:

+ !! end !! test @@ -5443,7 +5477,8 @@ Non-extlinks in brackets [{{echo|foo}}l's errand] [url={{echo|foo}}] [url=http://example.com] -!! html +[http:// bare protocols don't count] +!! html/php

[foo] [foo bar] [foo bar] @@ -5456,7 +5491,22 @@ Non-extlinks in brackets [fool's errand] [url=foo] [url=http://example.com] +[http:// bare protocols don't count]

+!! html/parsoid +

[foo] +[foo bar] +[foo bar] +[fool's] errand +[fool's errand] +[foo] +[foo bar] +[foo bar] +[fool's] errand +[fool's errand] +[url=foo] +[url=http://example.com] +[http:// bare protocols don't count]

!! end !! test @@ -6190,7 +6240,7 @@ Table cell attributes: Pipes protected by nowikis should be treated as a plain c | title="foo|" |bar | title="foo|" bar |} -!! html +!! html/php
bar @@ -6200,12 +6250,19 @@ Table cell attributes: Pipes protected by nowikis should be treated as a plain c title="foo|" bar
+!! html/parsoid + + + + +
barbar title="foo|" bar
!! end -# The "|}" to close the table is missing from the input, so parsoid's -# *2wt modes will fail. +# See: http://lists.wikimedia.org/mailman/htdig/wikitech-l/2006-April/022293.html +# N.B. The "|}" to close the table is missing from the input, so parsoid's +# *2wt modes will fail. !! test -Table security: embedded pipes (http://lists.wikimedia.org/mailman/htdig/wikitech-l/2006-April/022293.html) +Table security: embedded pipes !! options parsoid=wt2html,html2html !! wikitext @@ -6223,12 +6280,14 @@ parsoid=wt2html,html2html !! html/parsoid -
" onmouseover="alert(document.cookie)">test
+" onmouseover="alert(document.cookie)">test !! end -# FIXME: The php output is broken. +# FIXME: The output seems broken. Filed as T110268. !! test ! and || in td attributes should not be parsed as / +!! options +parsoid=wt2html !! wikitext {| | style="color: red !important;" data-contrived="put this here ||" | foo @@ -6242,7 +6301,7 @@ parsoid=wt2html,html2html !! html/parsoid - +
foo
style="color: red !important;" data-contrived="put this here foo
!! end @@ -6859,9 +6918,6 @@ parsoid=wt2html,wt2wt !! end - -# PHP throws away the (semi-broken) "foo" class here; Parsoid -# preserves it. !!test Parsoid: Recover better from broken table attributes !!options @@ -6872,7 +6928,7 @@ parsoid=wt2html foo |} !!html/php+tidy - +

foo

@@ -6887,6 +6943,23 @@ foo
!!end +!! test +Tables: Digest broken attributes on table and tr tag +!! options +parsoid=wt2html +!! wikitext +{| || |} ++ +|- || || ++ -- +|- > [ +|} +!! html + + + + +
+!! end + !! test Strip unsupported table tags !! options @@ -7097,8 +7170,10 @@ Link with HTML entity in suffix / tail Link with 3 brackets !! wikitext [[[Main Page]]] +Foo [[[Main Page]]] !! html

[[[Main Page]]] +Foo [[[Main Page]]]

!! end @@ -9877,27 +9952,33 @@ __proto__ Magic links: internal link to RFC (bug 479) !! wikitext [[RFC 123]] -!! html +!! html/php

RFC 123

+!! html/parsoid +

RFC 123

!! end !! test Magic links: RFC (bug 479) !! wikitext RFC 822 -!! html +!! html/php

RFC 822

+!! html/parsoid +

RFC 822

!! end !! test Magic links: RFC (bug 65278) !! wikitext This is RFC 822 but thisRFC 822 is not RFC 822linked. -!! html +!! html/php

This is RFC 822 but thisRFC 822 is not RFC 822linked.

+!! html/parsoid +

This is RFC 822 but thisRFC 822 is not RFC 822linked.

!! end !! test @@ -9906,20 +9987,26 @@ Magic links: RFC (w/ non-newline whitespace, bug 28950/29025) RFC       822 RFC 822 -!! html +!! html/php

RFC 822 RFC 822

+!! html/parsoid +

RFC       822 +RFC +822

!! end !! test Magic links: ISBN (bug 1937) !! wikitext ISBN 0-306-40615-2 -!! html +!! html/php

ISBN 0-306-40615-2

+!! html/parsoid +

ISBN 0-306-40615-2

!! end !! test @@ -9930,7 +10017,7 @@ This is ISBN 978-0-316-09811-3 but thisISBN 978-0-316-09811-3 is not ISBN 978-0-

This is ISBN 978-0-316-09811-3 but thisISBN 978-0-316-09811-3 is not ISBN 978-0-316-09811-3linked.

!! html/parsoid -

This is ISBN 978-0-316-09811-3 but thisISBN 978-0-316-09811-3 is not ISBN 978-0-316-09811-3linked.

+

This is ISBN 978-0-316-09811-3 but thisISBN 978-0-316-09811-3 is not ISBN 978-0-316-09811-3linked.

!! end !! test @@ -9941,31 +10028,41 @@ ISBN 9780316098113 ISBN 978 0316098113 -!! html +!! html/php

ISBN 978 0 316 09811 3 ISBN 9780316098113 ISBN 978 0316098113

+!! html/parsoid +

ISBN       978 0 316 09811 3 +ISBN +9780316098113 +ISBN 978 +0316098113

!! end !! test Magic links: PMID incorrectly converts space to underscore !! wikitext PMID 1234 -!! html +!! html/php

PMID 1234

+!! html/parsoid +

PMID 1234

!! end !! test Magic links: PMID (bug 65278) !! wikitext This is PMID 1234 but thisPMID 1234 is not PMID 1234linked. -!! html +!! html/php

This is PMID 1234 but thisPMID 1234 is not PMID 1234linked.

+!! html/parsoid +

This is PMID 1234 but thisPMID 1234 is not PMID 1234linked.

!! end !! test @@ -9974,11 +10071,15 @@ Magic links: PMID (w/ non-newline whitespace, bug 28950/29025) PMID       1234 PMID 1234 -!! html +!! html/php

PMID 1234 PMID 1234

+!! html/parsoid +

PMID       1234 +PMID +1234

!! end ### @@ -13267,7 +13368,7 @@ BUG 1887: A ISBN with a thumbnail
!! html/parsoid -
ISBN 1235467890
+
ISBN 1235467890
!! end !! test @@ -13765,9 +13866,9 @@ bar bar

!! end -## Edge case bug in Parsoid +## Edge case bugs in Parsoid from T93580 !! test -T93580: Templated inside images +T93580: 1. Templated inside block images !! wikitext [[File:Foobar.jpg|thumb|Caption with templated ref: {{echo|foo}}]] @@ -13778,6 +13879,30 @@ T93580: Templated inside images
  1. ↑ foo
!! end +!! test +T93580: 2. inside inline images +!! wikitext +[[File:Foobar.jpg|Undisplayed caption in inline image with ref: foo]] + + +!! html/parsoid +

+ +
  1. ↑ foo
+!! end + +!! test +T93580: 3. Templated inside inline images +!! wikitext +[[File:Foobar.jpg|Undisplayed caption in inline image with ref: {{echo|{{echo|foo}}}}]] + + +!! html/parsoid +

+ +
  1. ↑ foo
+!! end + ### ### Subpages ### @@ -15778,6 +15903,7 @@ MSIE 6 CSS safety test: sup/sub script (bug 55332) !! end +# FIXME: Parsoid fails to sanitize this! See T58846. !! test Opera -o-link CSS !! wikitext @@ -18237,7 +18363,7 @@ ISBN 978-0-1234-56 789 !! html+tidy

ISBN 978-0-1234-56 789

!! html/parsoid -

ISBN 978-0-1234-56 789

+

ISBN 978-0-1234-56 789

!! end !! test @@ -18257,7 +18383,7 @@ ISBN ISBN 1234567890

ISBN ISBN 1234567890

!! html/parsoid -

ISBN ISBN 1234567890

+

ISBN ISBN 1234567890

!! end # Uppercase X and lowercase x as well @@ -18279,12 +18405,12 @@ ISBN 978080442957x ISBN 978080442957x

!! html/parsoid -

ISBN 3-462-04561-X -ISBN 3-462-04561-x -ISBN 080442957X -ISBN 080442957x -ISBN 978080442957X -ISBN 978080442957x

+

ISBN 3-462-04561-X +ISBN 3-462-04561-x +ISBN 080442957X +ISBN 080442957x +ISBN 978080442957X +ISBN 978080442957x

!! end !! test @@ -18295,7 +18421,7 @@ ISBN 1234567890

ISBN 1234567890

!! html/parsoid -

ISBN 1234567890

+

ISBN 1234567890

!! end !! test @@ -18306,7 +18432,7 @@ Bug 22905: followed by ISBN followed by

(fr) ISBN 2753300917 example.com

!! html/parsoid -

(fr) ISBN 2753300917 example.com

+

(fr) ISBN 2753300917 example.com

!! end !! test @@ -20600,14 +20726,18 @@ __TOC__

[edit]

!! end +# Don't expect Parsoid to roundtrip this until the php parser comes closer to +# html5 tag parsing. !! test Tags with parameters in TOC +!! options +parsoid=wt2html !! wikitext __TOC__ == Hello == == Evilbye == -!! html +!! html/php

Contents

  • 1 Hello
  • @@ -20616,8 +20746,13 @@ __TOC__

Hello[edit]

-

b">Evilbye[edit]

+

b">Evilbye[edit]

+ +!! html/parsoid + +

Hello

+

b">Evilbye

!! end !! test @@ -21816,23 +21951,23 @@ Empty TR nodes should not be stripped if they have any attributes set !! test Headings: 0. Unnested !! options -parsoid +parsoid=html2wt +!! html/parsoid +

=foo=

+ +

=foo= + +=foo=

+ +

=fooa=

!! wikitext =foo= - =foo= + =foo= =foo= =foo''a''= -!! html -

=foo=

- -

=foo= - -=foo=

- -

=fooa=

!!end # New headings and existing headings are handled differently @@ -21889,15 +22024,26 @@ parsoid=html2wt !! test Headings: 3. Nested inside html with wikitext split by html tags !! options -parsoid=html2wt,wt2wt -!! wikitext -= ='''bold'''foo= = +parsoid=html2wt !! html/parsoid

=boldfoo=

+!! wikitext += ='''bold'''foo= = !!end !! test Headings: 4a. No escaping needed (testing just h1 and h2) +!! options +parsoid=html2wt +!! html/parsoid +

=foo

+

foo=

+

=foo=

+

=foo= bar

+

=foo

+

foo=

+

=

+

=foo=

!! wikitext = =foo = @@ -21914,15 +22060,6 @@ Headings: 4a. No escaping needed (testing just h1 and h2) = = = = ''=''foo= = -!! html/parsoid -

=foo

-

foo=

-

=foo=

-

=foo= bar

-

=foo

-

foo=

-

=

-

=foo=

!!end !! test @@ -21942,6 +22079,20 @@ parsoid=html2wt !! test Headings: 5. Empty headings +!! options +parsoid=html2wt +!! html/parsoid +

+ +

+ +

+ +

+ +
+ +
!! wikitext == @@ -21954,112 +22105,74 @@ Headings: 5. Empty headings ========== ============ -!! html/parsoid -

- -

- -

- -

- -
- -
!!end !! test Headings: 6a. Heading chars in SOL context (with trailing spaces) +!! options +parsoid=html2wt +!! html/parsoid +

=a=

+ +

=a=

+ +

=a=

!! wikitext =a= =a= =a= - -=a= -!! html/php -

=a= -

=a= -

=a= -

=a= -

-!! html/parsoid -

=a=

- -

=a=

- -

=a=

- -

=a=

!!end !! test Headings: 6b. Heading chars in SOL context (with trailing newlines) -!! wikitext -=a= -b - -=a= -b +!! options +parsoid=html2wt +!! html/parsoid +

=a= +b

-=a= -b +

=a= +b

-=a= -b -!! html/php -

=a= -b -

=a= -b -

=a= -b -

=a= +

=a= +b

+!! wikitext +=a= b -

-!! html/parsoid -

=a= -b

-

=a= -b

- -

=a= -b

+=a= +b -

=a= -b

+=a= +b !!end !! test Headings: 6c. Heading chars in SOL context (leading newline break) +!! options +parsoid=html2wt +!! html/parsoid +

a +=b=

!! wikitext a =b= -!! html/php -

a -=b= -

-!! html/parsoid -

a -=b= !!end !! test Headings: 6d. Heading chars in SOL context (with interspersed comments) -!! wikitext -=a= - -=a= -!! html/php -

=a= -

=a= -

+!! options +parsoid=html2wt !! html/parsoid -

=a=

+

=a=

-

=a=

+

=a=

+!! wikitext +=a= + +=a= !!end !! test @@ -22103,27 +22216,36 @@ a !! test Lists: 0. Outside nests +!! options +parsoid=html2wt +!! html/parsoid +

*foo

+ +

#foo

+ +

;Foo:bar

!! wikitext *foo #foo -;Foo:bar -!! html/php -

*foo -

#foo -

;Foo:bar -

-!! html/parsoid -

*foo

- -

#foo

- -

;Foo:bar

+;Foo:bar !!end !! test Lists: 1. Nested inside html +!! options +parsoid=html2wt +!! html/parsoid +
  • *foo
+
  • #foo
+
  • :foo
+
  • ;foo
+
  1. *foo
+
  1. #foo
+
  1. :foo
+
  1. ;foo
+ !! wikitext **foo @@ -22140,20 +22262,19 @@ Lists: 1. Nested inside html #:foo #;foo -!! html -
  • *foo
-
  • #foo
-
  • :foo
-
  • ;foo
-
  1. *foo
-
  1. #foo
-
  1. :foo
-
  1. ;foo
- !!end !! test Lists: 2. Inside definition lists +!! options +parsoid=html2wt +!! html/parsoid +
;foo
+
:foo
+
:foo
+
bar
+
:foo
+ !! wikitext ;;foo @@ -22163,40 +22284,27 @@ Lists: 2. Inside definition lists :bar ::foo -!! html -
;foo
-
:foo
-
:foo
-
bar
-
:foo
- !!end !! test Lists: 3. Only bullets at start of text should be escaped +!! options +parsoid=html2wt +!! html/parsoid +
  • *foo*bar
+
  • *fooit*bar
+ !! wikitext **foo*bar **foo''it''*bar -!! html -
  • *foo*bar
-
  • *fooit*bar
- !!end !! test Lists: 4. No escapes needed !! options -parsoid -!! wikitext -*foo*bar - -*''foo''*bar - -*[[Foo]]: bar - -*[[Foo]]*bar -!! html +parsoid=html2wt +!! html/parsoid
  • foo*bar
  • @@ -22213,10 +22321,29 @@ parsoid
  • Foo*bar
+!! wikitext +*foo*bar + +*''foo''*bar + +*[[Foo]]: bar + +*[[Foo]]*bar !!end !! test Lists: 5. No unnecessary escapes +!! options +parsoid=html2wt +!! html/parsoid +
  • bar [[foo]]
+
  • =bar [[foo]]
+
  • [[bar [[foo]]
+
  • ]]bar [[foo]]
+
  • =bar foo]]=
+
  • : a
+
  • * foo
+ !! wikitext * bar [[foo]] @@ -22231,15 +22358,6 @@ Lists: 5. No unnecessary escapes * : a * ''* foo'' -!! html -
  • bar [[foo]]
-
  • =bar [[foo]]
-
  • [[bar [[foo]]
-
  • ]]bar [[foo]]
-
  • =bar foo]]=
-
  • : a
-
  • * foo
- !!end !! test @@ -22254,13 +22372,15 @@ parsoid=html2wt !! test Lists: 7. Escape bullets in a multi-line context -!! wikitext -a -*b -!! html +!! options +parsoid=html2wt +!! html/parsoid

a *b

+!! wikitext +a +*b !!end !! test @@ -22279,17 +22399,16 @@ parsoid=html2wt !! test HRs: 1. Single line +!! options +parsoid=html2wt +!! html/parsoid +
---- +
=foo= +
*foo !! wikitext -------- ----=foo= ----*foo -!! html+tidy -
-

----

-
-

=foo=

-
-

*foo

!! end #### --------------- Tables --------------- @@ -22313,40 +22432,48 @@ HRs: 1. Single line !! test Tables: 1a. Simple example -!! wikitext -{| -|} -!! html +!! options +parsoid=html2wt +!! html/parsoid

{| |}

+!! wikitext +{| +|} !! end !! test Tables: 1b. No escaping needed -!! wikitext -!foo -!! html +!! options +parsoid=html2wt +!! html/parsoid

!foo

+!! wikitext +!foo !! end !! test Tables: 1c. No escaping needed -!! wikitext -|foo -!! html +!! options +parsoid=html2wt +!! html/parsoid

|foo

+!! wikitext +|foo !! end !! test Tables: 1d. No escaping needed -!! wikitext -|}foo -!! html +!! options +parsoid=html2wt +!! html/parsoid

|}foo

+!! wikitext +|}foo !! end !! test @@ -22407,11 +22534,8 @@ parsoid=html2wt !! test Tables: 2c. Nested in td -- no escaping needed -!! wikitext -{| - -|foo!!bar -|} +!! options +parsoid=html2wt !! html/* @@ -22419,15 +22543,17 @@ Tables: 2c. Nested in td -- no escaping needed
foo!!bar
-!! end - -!! test -Tables: 3a. Nested in th !! wikitext {| -!foo!bar +|foo!!bar |} +!! end + +!! test +Tables: 3a. Nested in th +!! options +parsoid=html2wt !! html/* @@ -22435,6 +22561,11 @@ Tables: 3a. Nested in th
foo!bar
+!! wikitext +{| + +!foo!bar +|} !! end !! test @@ -22543,6 +22674,19 @@ parsoid=html2wt !! test Tables: 4c. No escaping needed +!! options +parsoid=html2wt +!! html/parsoid + + + + + +
foo-barfoo+bar
foo-barfoo+bar
foo +

bar|baz ++bar +-bar

x +
a|b
!! wikitext {| |foo-bar @@ -22583,21 +22727,18 @@ bar|baz
a|b
-!! html/parsoid - - - - - -
foo-barfoo+bar
foo-barfoo+bar
foo -

bar|baz -+bar --bar

x -
a|b
!! end !! test Tables: 4d. No escaping needed +!! options +parsoid=html2wt +!! html/parsoid + + + + +
Foo-bar+1-2
!! wikitext {| |[[Foo]]-bar @@ -22614,29 +22755,6 @@ Tables: 4d. No escaping needed -2 -!! html/parsoid - - - - -
Foo-bar+1-2
-!! end - -!! test -Tables: Digest broken attributes on table and tr tag -!! options -parsoid=wt2html -!! wikitext -{| || |} ++ -|- || || ++ -- -|- > [ -|} -!! html - - - - -
!! end !! test @@ -22648,11 +22766,18 @@ parsoid=html2wt |** Make this another long long long sentence forcing the nowiki algo to split up the nowikis.

!! wikitext *This is a long sentence here that will make the nowiki algo split up the nowikis into multiple pairs -|** Make this another long long long sentence forcing the nowiki algo to split up the nowikis. +|** Make this another long long long sentence forcing the nowiki algo to split up the nowikis. !! end !! test Unclosed xmlish element in table line shouldn't eat end delimiters +!! options +parsoid=html2wt +!! html/parsoid + + + +
<foo bar>
!! wikitext {| | bar> -!! html/parsoid - - - -
<foo bar>
!! end #### --------------- Links ---------------- @@ -22682,6 +22802,12 @@ Unclosed xmlish element in table line shouldn't eat end delimiters #### -------------------------------------- !! test Links 1. WikiLinks: No escapes needed +!! options +parsoid=html2wt +!! html/parsoid +

Fooboo +[Foobar] +x [Foobar] x

!! wikitext [[Foo|Foo''boo'']] [[Foo|[Foobar]]] @@ -22691,10 +22817,6 @@ Links 1. WikiLinks: No escapes needed [Foobar] x [Foobar] x

-!! html/parsoid -

Fooboo -[Foobar] -x [Foobar] x

!! end !! test @@ -22739,6 +22861,11 @@ parsoid=html2wt !! test Links 3. WikiLinks: No escapes needed +!! options +parsoid=html2wt +!! html/parsoid +

[Foobar +foo|bar

!! wikitext [[Foo|[Foobar]] [[Foo|foo|bar]] @@ -22746,9 +22873,6 @@ Links 3. WikiLinks: No escapes needed

[Foobar foo|bar

-!! html/parsoid -

[Foobar -foo|bar

!! end !! test @@ -22778,17 +22902,21 @@ parsoid=html2wt !! test Links 5. ExtLinks: No escapes needed +!! options +parsoid=html2wt +!! html/parsoid +

[google

!! wikitext [http://google.com [google] !! html/php

[google

-!! html/parsoid -

[google

!! end !! test Links 6. Add s between text-nodes and url-links when required (bug 64300) +!! options +parsoid=html2wt !! html/parsoid

xhttp://example.comy http://example.com?x @@ -22822,6 +22950,8 @@ http://example.com(x) !! test Links 7a. Don't add spurious s between text-nodes and url-links (bug 64300) +!! options +parsoid=html2wt !! html/parsoid

x http://example.com @@ -22855,6 +22985,8 @@ y !! test Links 7b. Don't add spurious s between text-nodes and url-links (bug 64300) +!! options +parsoid=html2wt !! html/parsoid

http://example.com.,;:!?\ -http://example.com:

@@ -22869,6 +23001,8 @@ http://example.com.,;:!?\ !! test Links 8. Add s between text-nodes and RFC-links when required (bug 64300) +!! options +parsoid=html2wt !! html/parsoid

RFC 1234 RFC 123y @@ -22881,6 +23015,8 @@ XRFC 123y !! test Links 9. Don't add spurious s between text-nodes and RFC-links (bug 64300) +!! options +parsoid=html2wt !! html/parsoid

RFC 123?foo RFC 123&foo @@ -22899,6 +23035,8 @@ RFC 123&foo !! test Links 10. Add s between text-nodes and PMID-links when required (bug 64300) +!! options +parsoid=html2wt !! html/parsoid

PMID 1234 PMID 123y @@ -22911,6 +23049,8 @@ XPMID 123y !! test Links 11. Don't add spurious s between text-nodes and PMID-links (bug 64300) +!! options +parsoid=html2wt !! html/parsoid

PMID 123?foo PMID 123&foo @@ -22929,10 +23069,12 @@ PMID 123&foo !! test Links 12. Add s between text-nodes and ISBN-links when required (bug 64300) +!! options +parsoid=html2wt !! html/parsoid -

ISBN 12345678901 -ISBN 1234567890x -aISBN 1234567890b +

ISBN 12345678901 +ISBN 1234567890x +aISBN 1234567890b

!! wikitext ISBN 12345678901 @@ -22942,8 +23084,10 @@ aISBN 1234567890b !! test Links 13. Don't add spurious s between text-nodes and ISBN-links (bug 64300) +!! options +parsoid=html2wt !! html/parsoid -

-ISBN 1234567890's +

-ISBN 1234567890's !! wikitext -ISBN 1234567890's !! html/php @@ -22966,13 +23110,14 @@ parsoid=html2wt Links 15. Link trails can't become link prefixes. !! options language=is +parsoid=html2wt +!! html/parsoid +

Söfnuður-00

!! wikitext [[Söfnuður]]-[[00]] !! html/php

Söfnuður-00

-!! html/parsoid -

Söfnuður-00

!! end #### --------------- Quotes --------------- @@ -22984,28 +23129,7 @@ language=is !! test 1a. Quotes inside and !! options -parsoid=html2wt,wt2wt -!! wikitext -'''foo''' -''''foo'''' -'''''foo''''' -''foo'''s -''''foo'''' -'''''foo''''' -''''''foo'''''' -'''foo'''bar'''baz''' -'''foo''''s -'''foo'' -''foo''' -''foo'''' -'''foo''' -''''foo''' -'''foo'''' -''''foo'''' -''fools' errand'' -''fool's errand'' -'''foo'' bar '''baz'' -a|!*#-:;+-~[]{}b'''x'' +parsoid=html2wt !! html/*

'foo' ''foo'' @@ -23028,22 +23152,34 @@ a|!*#-:;+-~[]{}b'''x'' 'foo bar 'baz a|!*#-:;+-~[]{}b'x

+!! wikitext +'''foo''' +''''foo'''' +'''''foo''''' +''foo'''s +''''foo'''' +'''''foo''''' +''''''foo'''''' +'''foo'''bar'''baz''' +'''foo''''s +'''foo'' +''foo''' +''foo'''' +'''foo''' +''''foo''' +'''foo'''' +''''foo'''' +''fools' errand'' +''fool's errand'' +'''foo'' bar '''baz'' +a|!*#-:;+-~[]{}b'''x'' !! end !! test 1b. Quotes inside and with other tags on same line !! options -parsoid=html2wt,wt2wt -!! wikitext -'''a'' foo ''[[bar]]'' -''a''' foo ''[[bar]]'' -''a''' foo '''{{echo|[[bar]]}}''' -[[foo]] x'''[[bar]]'' -'''foo'' test -'''foo''
test
-'''foo'' and
bar - -!! html +parsoid=html2wt +!! html/parsoid 'a foo bar a' foo bar a' foo bar @@ -23054,45 +23190,58 @@ parsoid=html2wt,wt2wt
  1. ↑ test
+!! wikitext +'''a'' foo ''[[bar]]'' +''a''' foo ''[[bar]]'' +''a''' foo '''{{echo|[[bar]]}}''' +[[foo]] x'''[[bar]]'' +'''foo'' test +'''foo''
test
+'''foo'' and
bar + !! end !! test 2. Link fragments separated by and tags +!! options +parsoid=html2wt +!! html/parsoid +

[[foohello]]

+

[[foohello]]

!! wikitext [[''foo''hello]] [['''foo'''hello]] -!! html -

[[foohello]] -

[[foohello]] -

!! end # FIXME: Escaping one or both of [[ and ]] is also acceptable -- # this is one of the shortcomings of this format !! test 3. Link fragments inside and +!! options +parsoid=html2wt +!! html/parsoid +

[[foo]]

+

[[foo]]

!! wikitext ''[[foo'']] '''[[foo''']] -!! html -

[[foo]] -

[[foo]] -

!! end !! test 4. No escaping needed -!! wikitext -'''bar''' -''''bar'''' -'a:b'foo -!! html +!! options +options=html2wt +!! html/parsoid

'bar' 'bar' 'a:b'foo

+!! wikitext +'''bar''' +''''bar'''' +'a:b'foo !! end #### ----------- Paragraphs --------------- @@ -23101,6 +23250,15 @@ parsoid=html2wt,wt2wt !! test 1. No unnecessary escapes +!! options +parsoid=html2wt +!! html/parsoid +

bar [[foo]] +

=bar [[foo]] +

[[bar [[foo]] +

]]bar [[foo]] +

=bar foo]]= +

!! wikitext bar [[foo]] @@ -23111,13 +23269,6 @@ bar [[foo]] ]]bar [[foo]] =bar foo]]= -!! html -

bar [[foo]] -

=bar [[foo]] -

[[bar [[foo]] -

]]bar [[foo]] -

=bar foo]]= -

!!end #### ----------------------- PRE -------------------------- @@ -23126,83 +23277,103 @@ bar [[foo]] !! test 1. Leading whitespace in SOL context should be escaped !! options -parsoid +parsoid=html2wt +!! html/parsoid +

a

+ +

a

+ +

a(tab)

+ +

a + + a

+ +

a + b

+ +

a + b

+ +

a + b

!! wikitext a a - a(tab) + a(tab) a - a + a a b a - b + b a - b -!! html -

a

-

a

-

a(tab)

-

a

-

a

-

a - b

-

a - b

-

a - b

+ b +!! html/php +

a +

a +

a(tab) +

a + a +

a + b +

a + b +

a + b +

!! end !! test 2. Leading whitespace in non-indent-pre contexts should not be escaped !! options -parsoid -!! wikitext -foo ''a'' - b - -!! html +parsoid=htm2wt +!! html/parsoid

foo [1]

  1. ↑ a b
+!! wikitext +foo ''a'' + b + !! end !! test 3. Leading whitespace in indent-pre suppressing contexts should not be escaped !! options -parsoid -!! wikitext +parsoid=html2wt +!! html/parsoid
+

a b - c + c

-!! html +!! wikitext
-

a b - c

+ c
!! end !! test 4. Leading whitespace in indent-pre suppressing contexts should not be escaped !! options -parsoid -!! wikitext - [[File:Foobar.jpg|thumb|caption]] +options=html2wt !! html/parsoid
caption
+!! wikitext + [[File:Foobar.jpg|thumb|caption]] !! end !! test @@ -23218,15 +23389,15 @@ parsoid=html2wt !!test T95794: nowiki escaping should account for leading space at start-of-line in an indent-pre block !! options -parsoid -!! wikitext - * foo - * bar -!! html +parsoid=html2wt +!! html/parsoid
 * foo
 * bar
 
+!! wikitext + * foo + * bar !! end #### --------------- Behavior Switches -------------------- @@ -23258,15 +23429,8 @@ __|__ # We use indent-pre as an indirect way to test for sol-transparent behavior. !! test Behavior switches should be SOL-transparent -!! wikitext - __TOC__ - - - __TOO__ - - __TOC__ foo - -__TOC__ bar +!! options +parsoid=html2wt !! html/parsoid @@ -23276,6 +23440,15 @@ __TOC__ bar
 foo
bar
+!! wikitext + __TOC__ + + + __TOO__ + + __TOC__ foo + +__TOC__ bar !! end #### --------------- HTML tags --------------- @@ -23287,75 +23460,85 @@ __TOC__ bar !! test 1. a tags !! options -parsoid +parsoid=html2wt +!! html/parsoid +<a href="http://google.com">google</a> !! wikitext google -!! html -<a href="http://google.com">google</a> !! end !! test 2. other tags -!! wikitext -*
foo
-*
foo
-* -!! html +!! options +parsoid=html2wt +!! html/parsoid
  • <div>foo</div>
  • <div style="color:red">foo</div>
  • <td>
+!! wikitext +*
foo
+*
foo
+* !! end !! test 3. multi-line html tag -!! wikitext -
foo
-!! html +!! options +parsoid=html2wt +!! html/parsoid

<div >foo</div >

+!! wikitext +
foo
!! end !! test 4. extension tags +!! options +parsoid=html2wt +!! html/parsoid +

<ref>foo</ref> +

<ref>bar +

baz</ref> +

!! wikitext foo bar baz
-!! html -

<ref>foo</ref> -

<ref>bar -

baz</ref> -

!! end #### --------------- Others --------------- !! test Escaping nowikis -!! wikitext -<nowiki>foo</nowiki> -!! html +!! options +parsoid=html2wt +!! html/parsoid

<nowiki>foo</nowiki>

+!! wikitext +<nowiki>foo</nowiki> !! end ## The quote-char in the input is necessary for triggering the bug !! test (Bug 52035) Nowiki-escaping should not get tripped by " :" in text !! options -parsoid=wt2wt,html2wt +parsoid=html2wt +!! html/parsoid +

foo's bar :

!! wikitext foo's bar : -!! html -

foo's bar :

!! end +#----------- End of wikitext escaping tests -------------- + !! test Tag-like HTML structures are passed through as text @@ -23407,20 +23590,9 @@ HTML tag with broken attribute value quoting !! wikitext Foo

-!! end - -!! test -Parsoid-only: HTML tag with broken attribute value quoting -!! options -parsoid -!! wikitext -Foo

!! end @@ -23434,7 +23606,7 @@ Table with broken attribute value quoting !! html/php -
Foo +Foo
!! html/parsoid @@ -23455,9 +23627,9 @@ Table with broken attribute value quoting on consecutive lines !! html/php - -
Foo +Foo Bar +Bar
!! html/parsoid @@ -23470,7 +23642,7 @@ Table with broken attribute value quoting on consecutive lines !! end !! test -Parsoid-only: Don't wrap broken template tags in on wt2wt (Bug 42353) +2. Parsoid-only: Don't wrap broken template tags in on wt2wt (Bug 42353) !! options parsoid !! wikitext @@ -23480,7 +23652,7 @@ parsoid !! end !! test -Parsoid-only: Don't wrap broken template tags in on wt2wt (Bug 42353) +1. Parsoid-only: Don't wrap broken template tags in on wt2wt (Bug 42353) !! options parsoid !! wikitext @@ -24529,7 +24701,7 @@ parsoid={ == [[Category:A2]] hi pal == -== [[Category:A3]] how goes it == +== [[Category:A3]] how goes it == == it goes well [[Category:A4]] == @@ -24981,7 +25153,7 @@ Edited ISBN links not serializable as ISBN links should serialize as wikilinks !! options parsoid=html2wt !! html/parsoid -ISBN 1234567895 +ISBN 1234567895 !! wikitext [[Special:BookSources/1234567890|ISBN 1234567895]] !! end @@ -25091,6 +25263,92 @@ parsoid=html2wt http://example.com http://example.com is not a link. !! end +!! test +Magic links inside links (not autolinked) +!! wikitext +[[Foo|http://example.com]] +[[Foo|RFC 1234]] +[[Foo|PMID 1234]] +[[Foo|ISBN 123456789x]] + +[http://foo.com http://example.com] +[http://foo.com RFC 1234] +[http://foo.com PMID 1234] +[http://foo.com ISBN 123456789x] +!! html+tidy +

http://example.com RFC 1234 PMID 1234 ISBN 123456789x

+

http://example.com RFC 1234 PMID 1234 ISBN 123456789x

+!! html/parsoid +

http://example.com +RFC 1234 +PMID 1234 +ISBN 123456789x

+ +

http://example.com +RFC 1234 +PMID 1234 +ISBN 123456789x

+!! end + +!! test +Magic links inside image captions (autolinked) +!! wikitext +[[File:Foobar.jpg|thumb|http://example.com]] +[[File:Foobar.jpg|thumb|RFC 1234]] +[[File:Foobar.jpg|thumb|PMID 1234]] +[[File:Foobar.jpg|thumb|ISBN 123456789x]] +!! html+tidy +
+ +
+
+
+ +
+
+
+
+ +
+
+
+ +
+!! html/parsoid +
http://example.com
+
RFC 1234
+
PMID 1234
+
ISBN 123456789x
+!! end + +!! test +WTS of magic word text (T109371) +!! options +parsoid=html2wt +!! html/parsoid +

RFC 1234

+

RFC 1234

+

RFC 1234

+!! wikitext +RFC 1234 + +[http://foo.com RFC 1234] + +[[Foo|RFC 1234]] +!! end + !! test Edited Redirect link should emit a non-piped wikitext link !! options @@ -25796,6 +26054,16 @@ parsoid={ !! end +!! test +Escape nowiki DOM elements +!! options +parsoid=html2wt +!! html/parsoid +foo +!! wikitext +<nowiki>''foo''</nowiki> +!! end + # --------------------------------------------------- # End of tests spec'ing wikitext serialization norms | # ---------------------------------------------------