From 2d26a0c535191d5261e5b379230c89ad3b988935 Mon Sep 17 00:00:00 2001
From: "C. Scott Ananian"
foo | +bar | +
this text +should be left alone
+!! end + +!! test +Definition Lists: Hacky use to indent tables, with comment before table +!! wikitext +::{| +|foo +|} +!! html/parsoid +foo | +
Numbered: [1] Numbered: [2] Numbered: [3]
+!! html/parsoid +Numbered: +Numbered: +Numbered:
!!end !! test @@ -3685,28 +3722,50 @@ http://example.com/1$2345 !! end +# parsoid doesn't explicitly mark autonumbered links, see bug 53505 !! test -External links: dollar sign in URL (named) +External links: dollar sign in URL (autonumber) !! wikitext [http://example.com/1$2345] -!! html +!! html/php +!! html/parsoid + !!end !! test External links: open square bracket forbidden in URL (bug 4377) +!! options +parsoid=wt2html,wt2wt,html2html !! wikitext http://example.com/1[2345 -!! html +!! html/phphttp://example.com/1[2345
+!! html/parsoid +http://example.com/1[2345
!! end !! test External links: open square bracket forbidden in URL (named) (bug 4377) +!! options +parsoid=wt2html,html2html !! wikitext [http://example.com/1[2345] +!! html/php +[2345 +
+!! html/parsoid + +!!end + +# parsoid adds a space before the link name +!! test +External links: open square bracket forbidden in URL (named) (bug 4377) +Parsoid variant. +!! wikitext +[http://example.com/1 [2345] !! html @@ -3750,13 +3809,16 @@ External links: protocol-relative URL in brackets !! end +# parsoid doesn't explicitly mark autonumbered links, see bug 53505 !! test External links: protocol-relative URL in brackets without text !! wikitext [//example.com] -!! html +!! html/php +!! html/parsoid + !! end !! test @@ -3882,54 +3944,95 @@ Old & use: http://x&y External links: encoded ampersand !! wikitext Old & use: http://x&y -!! html +!! html/phpOld & use: http://x&y
+!! html/parsoid +Old & use: http://x&y
!! end !! test External links: encoded equals (bug 6102) !! wikitext http://example.com/?foo=bar -!! html +!! html/php +!! html/parsoid + !! end +## +## Note that parsoid doesn't explicit mark autonumbered links, nor +## does it number them. As discussed in bug 53505, we can identify +## autonumbered links via CSS. +## + !! test External links: [raw ampersand] !! wikitext Old & use: [http://x&y] -!! html +!! html/phpOld & use: [1]
+!! html/parsoid + !! end +# note that parsoid html is identical to [raw ampersand] case; so html2wt +# mode will return the [raw ampersand] wikitext !! test External links: [encoded ampersand] +!! options +parsoid=wt2html,wt2wt,html2html !! wikitext Old & use: [http://x&y] -!! html +!! html/phpOld & use: [1]
+!! html/parsoid + +!! end + +!! test +External links: [raw equals] +!! wikitext +[http://example.com/?foo=bar] +!! html/php +[1] +
+!! html/parsoid + !! end +# note that parsoid html is identical to [raw equals] case; so html2wt +# mode will return the [raw equals] wikitext !! test External links: [encoded equals] (bug 6102) +!! options +parsoid=wt2html,wt2wt,html2html !! wikitext [http://example.com/?foo=bar] -!! html +!! html/php +!! html/parsoid + !! end +# xxx parsoid strips the IDN character, so the round-trip tests will +# obviously fail and are disabled. --cscott !! test External links: [IDN ignored character reference in hostname; strip it right off] +!! options +parsoid=wt2html,wt2wt,html2html !! wikitext [http://example.com/] -!! html +!! html/php +!! html/parsoid + !! end # FIXME: This test (the IDN characters in the text of a link) is an inconsistency. @@ -3949,13 +4052,19 @@ External links: [IDN ignored character reference in hostname; strip it right off # # All our love, # The Parsoid team. +# xxx parsoid strips the IDN character, so the round-trip tests will +# obviously fail and are disabled. --cscott !! test External links: IDN ignored character reference in hostname; strip it right off +!! options +parsoid=wt2html,html2html !! wikitext http://example.com/ -!! html +!! html/php +!! html/parsoid + !! end !! test @@ -3967,13 +4076,16 @@ http://www.jpeg.org !! end +# parsoid doesn't explicitly mark autonumbered links, see bug 53505 !! test External links: URL within URL (original bug 2) !! wikitext [http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp] -!! html +!! html/php +!! html/parsoid + !! end !! test @@ -4122,9 +4234,11 @@ Bug 2702: Mismatched , and tags are invalid Bug 4781: %26 in URL !! wikitext http://www.example.com/?title=AT%26T -!! html +!! html/phphttp://www.example.com/?title=AT%26T
+!! html/parsoid +http://www.example.com/?title=AT%26T
!! end # According to http://dev.w3.org/html5/spec/Overview.html#parsing-urls a plain @@ -4133,18 +4247,22 @@ http://www.example.com/?title=AT%26T Bug 4781, 5267: %25 in URL !! wikitext http://www.example.com/?title=100%25_Bran -!! html +!! html/phphttp://www.example.com/?title=100%25_Bran
+!! html/parsoid +http://www.example.com/?title=100%25_Bran
!! end !! test Bug 4781, 5267: %28, %29 in URL !! wikitext http://www.example.com/?title=Ben-Hur_%281959_film%29 -!! html +!! html/phphttp://www.example.com/?title=Ben-Hur_%281959_film%29
+!! html/parsoid +http://www.example.com/?title=Ben-Hur_%281959_film%29
!! end @@ -4152,27 +4270,33 @@ http://www.example.com/?title=Ben-Hur_%281959_film%29 Bug 4781: %26 in autonumber URL !! wikitext [http://www.example.com/?title=AT%26T] -!! html +!! html/php +!! html/parsoid + !! end !! test Bug 4781, 5267: %26 in autonumber URL !! wikitext [http://www.example.com/?title=100%25_Bran] -!! html +!! html/php +!! html/parsoid + !! end !! test Bug 4781, 5267: %28, %29 in autonumber URL !! wikitext [http://www.example.com/?title=Ben-Hur_%281959_film%29] -!! html +!! html/php +!! html/parsoid + !! end @@ -4180,13 +4304,15 @@ Bug 4781, 5267: %28, %29 in autonumber URL Bug 4781: %26 in bracketed URL !! wikitext [http://www.example.com/?title=AT%26T link] -!! html +!! html/php +!! html/parsoid + !! end !! test -Bug 4781, 5267: %26 in bracketed URL +Bug 4781, 5267: %25 in bracketed URL !! wikitext [http://www.example.com/?title=100%25_Bran link] !! html @@ -4198,11 +4324,57 @@ Bug 4781, 5267: %26 in bracketed URL Bug 4781, 5267: %28, %29 in bracketed URL !! wikitext [http://www.example.com/?title=Ben-Hur_%281959_film%29 link] -!! html +!! html/php +!! html/parsoid + +!! end + +# Note that parsoid does not munge anchor text; all non-space +# characters are valid in HTML5 ids. +!! test +Anchor containing a #. (bug 63430) +!! wikitext +[[Main Page#And#Link]] +!! html/php + +!! html/parsoid + !! 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 + + +!! 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 + + +!! end + + !! test External link containing double-single-quotes in text '' (bug 4598 sanity check) !! wikitext @@ -4265,10 +4437,14 @@ Brackets in urls http://example.com/index.php?foozoid%5B%5D=bar http://example.com/index.php?foozoid[]=bar -!! html +!! html/phphttp://example.com/index.php?foozoid%5B%5D=bar
http://example.com/index.php?foozoid%5B%5D=bar
+!! html/parsoid +http://example.com/index.php?foozoid%5B%5D=bar
+ +http://example.com/index.php?foozoid[]=bar
!! end !! test @@ -4902,12 +5078,16 @@ Invalid attributes in table cell (bug 1830) !! end +# 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) +!! options +parsoid=wt2html,html2html !! wikitext {| | |[ftp://|x||]" onmouseover="alert(document.cookie)">test -!! html +!! html/php[ftp://%7Cx | @@ -4916,6 +5096,10 @@ Table security: embedded pipes (http://lists.wikimedia.org/mailman/htdig/wikitec
" onmouseover="alert(document.cookie)">test |
7% Solution +!! html/php +
+!! html/parsoid + !! end +# note that the parsoid HTML is identical to the previous test output, +# so the previous test ensures that the html2wt mode will generate the +# "not as a hex sequence" wikitext. !! test Link containing % as a single hex sequence interpreted to char +!! options +parsoid=wt2wt,wt2html,html2html !! wikitext [[7%25 Solution]] -!! html -7% Solution +!! html/php +
+!! html/parsoid + !!end !! test @@ -5481,14 +5691,18 @@ Link containing % as a double hex sequence interpreted to hex sequence !!end +# note that parsoid does not munge anchor text; all non-space +# characters are valid in HTML5 anchors. !! test Link containing "#<" and "#>" % as a hex sequences- these are valid section anchors Example for such a section: == < == !! wikitext [[%23%3c]][[%23%3e]] -!! html +!! html/php +!! html/parsoid + !! end !! test @@ -5504,9 +5718,11 @@ Link containing "<#" and ">#" as a hex sequences Link containing an equals sign !! wikitext [[Special:BookSources/isbn=4-00-026157-6]] -!! html +!! html/phpSpecial:BookSources/isbn=4-00-026157-6
+!! html/parsoid +Special:BookSources/isbn=4-00-026157-6
!! end !! article @@ -5522,33 +5738,39 @@ Just a test of an article title containing a tilde. Link containing a tilde !! wikitext [[Foo~bar]] -!! html +!! html/php +!! html/parsoid + !! end !! test Link containing double-single-quotes '' (bug 4598) !! wikitext [[Lista d''e paise d''o munno]] -!! html +!! html/php +!! html/parsoid + !! end !! test Link containing double-single-quotes '' in text (bug 4598 sanity check) !! wikitext Some [[Link|pretty ''italics'' and stuff]]! -!! html +!! html/phpSome pretty italics and stuff!
+!! html/parsoid +Some pretty italics and stuff!
!! end !! test Link containing double-single-quotes '' in text embedded in italics (bug 4598 sanity check) !! wikitext -''Some [[Link|pretty ''italics'' and stuff]]! +''Some [[Link|pretty ''italics'' and stuff]]!'' !! htmlSome pretty italics and stuff!
@@ -5564,12 +5786,17 @@ Link with double quotes in title part (literal) and alternate part (interpreted) [[''Pentecoste''|Pentecoste]] [[''Pentecoste''|''Pentecoste'']] -!! html +!! html/phpFile:Denys Savchenko Pentecoste.jpg
+!! html/parsoid + + + + !! end !! test @@ -5591,9 +5818,11 @@ Broken image links with HTML captions (bug 39700) Plain link to URL !! wikitext [[http://www.example.com]] -!! html +!! html/php[[1]]
+!! html/parsoid + !! end !! test @@ -5609,9 +5838,11 @@ Plain link to URL with link text Plain link to protocol-relative URL !! wikitext [[//www.example.com]] -!! html +!! html/php[[1]]
+!! html/parsoid + !! end !! test @@ -5651,29 +5882,36 @@ Plain link to page with question mark in title Piped link to URL !! wikitext Piped link to URL: [[http://www.example.com|an example URL]] -!! html +!! html/phpPiped link to URL: [example URL]
+!! html/parsoid +Piped link to URL: [example URL]
!! end !! test BUG 2: [[page|http://url/]] should link to page, not http://url/ !! wikitext [[Main Page|http://url/]] -!! html +!! html/php +!! html/parsoid + !! end +# Parsoid does not mark self-links, by design. !! test BUG 337: Escaped self-links should be bold !! options title=[[Bug462]] !! wikitext [[Bug462]] [[Bug462]] -!! html +!! html/phpBug462 Bug462
+!! html/parsoid + !! end !! test @@ -5997,8 +6235,6 @@ Different interwiki prefixes mapping to the same URL !! test Interwiki links that cannot be represented in wiki syntax -!! options -parsoid !! wikitext [[meatball:ok]] [[meatball:ok#foo|ok with fragment]] @@ -6006,10 +6242,10 @@ parsoid [http://de.wikipedia.org/wiki/Foo?action=history has query] [http://de.wikipedia.org/wiki/#foo is just fragment] -!! html +!! html/parsoidmeatball:ok ok with fragment -ok ending with ? mark +ok ending with ? mark has query is just fragment
!! end @@ -8748,7 +8984,7 @@ parsoid !!end !!test -Templates: Inline Text: 1. Multiple tmeplate uses +Templates: Inline Text: 1. Multiple template uses !! wikitext {{echo|Foo}}bar{{echo|baz}} !! html @@ -9263,6 +9499,33 @@ Templates: Ugly templates: 4. newline-only template parameter inconsistency !! end +# Bug 64017 -- ugly wikitext with fostered content generates two template ranges that +# have a true overlap (T1-start - T2-start - T1-end - T2-end). +!! test +Templates: Ugly templates: 5. Template encapsulation test: Non-trivial overlap of template ranges is properly handled +!! wikitext +{{echo|
![]() ![]() ![]() ![]() ![]() ![]() link] +!! html/parsoid +link] !! end !! test Bug 2095: link with pipe and three closing brackets, version 2 !! wikitext [[Main Page|[http://example.com/]]] -!! html +!! html/php +!! html/parsoid + !! end @@ -13565,6 +13848,7 @@ HTML ordered list item with parameters oddity !! end +# parsoid doesn't explicitly mark autonumbered links, see bug 53505 !!test bug 5918: autonumbering !! wikitext @@ -13577,13 +13861,19 @@ ftp://inlineftp [mailto:enclosed@mail.tld] mailto:inline@mail.tld -!! html +!! html/php +!! html/parsoid + + + + + !! end @@ -14786,17 +15076,39 @@ xxx !! test Handling of in URLs !! wikitext -**irc:// a -!! html +** irc:// a +!! html/php -!!end +!! html/parsoid + +!! end + +!! test +Handling of %0A in URLs +!! wikitext +** irc://%0Aa +!! html/php +
JavaScript +!! html/parsoid +JavaScript !! end !! test HTML Hex character encoding bogus encoding (bug 26437 regression check) !! wikitext see;SEE; -!! html +!! html/php&#xsee;&#XSEE; +!! html/parsoid +&#xsee;&#XSEE; !! end !! test HTML Hex character encoding mixed case +!! options +parsoid=wt2html,wt2wt,html2html !! wikitext îî -!! html +!! html/phpîî +!! html/parsoid +îî !! end !! test @@ -15362,11 +15684,13 @@ disabled !! test Images with the "|" character in the comment !! wikitext -[[image:Foobar.jpg|thumb|An [http://test/?param1=|left|¶m2=|x external] URL]] -!! html +[[File:Foobar.jpg|thumb|An [http://test/?param1=|left|¶m2=|x external] URL]] +!! html/php![]() An external URL ![]() b !! end +!! test +Substrings resembling wikitext in hrefs should not get nowiki escapes +!! options +parsoid=html2wt +!! wikitext +[[Foo''bar''baz]] +!! html +Foo''bar''baz +!! end + #----------------------------- # I/B quote minimization tests #----------------------------- @@ -20419,9 +20769,9 @@ Bug 54262: New entities !! options parsoid=html2wt !! wikitext -foo + !! html -foo + !! end ## Note that there is no wikitext output for 'unknownproperty' ## -- cgit v1.2.3 |