X-Git-Url: https://git.cyclocoop.org/%242?a=blobdiff_plain;f=tests%2Fparser%2FparserTests.txt;h=4c6c9a5b31ceb2ff077a7f8a858f77e70241cd09;hb=a05971dfc7fdd78be02edae4855ca808dc599cda;hp=9cada85c821ad1493e683b2ba5b37e6cec6af6fc;hpb=0a138f1acf224675f1a70eff8eea63c8d70a17dc;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 9cada85c82..4c6c9a5b31 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -4646,6 +4646,9 @@ http://example.com? http://example.com) http://example.com/url_with_(brackets) (http://example.com/url_without_brackets) +http://example.com/url_with_entity& +http://example.com/url_with_entity& +http://example.com/url_with_entity& http://example.com/url_with_entity http://example.com/url_with_entity http://example.com/url_with_entity @@ -4663,12 +4666,15 @@ http://example.com/url_with_entity< http://example.com) http://example.com/url_with_(brackets) (http://example.com/url_without_brackets) -http://example.com/url_with_entity -http://example.com/url_with_entity -http://example.com/url_with_entity +http://example.com/url_with_entity& +http://example.com/url_with_entity& +http://example.com/url_with_entity& +http://example.com/url_with_entity +http://example.com/url_with_entity +http://example.com/url_with_entity http://example.com/url_with_entity< -http://example.com/url_with_entity%3C -http://example.com/url_with_entity%3C +http://example.com/url_with_entity< +http://example.com/url_with_entity<
!! html/parsoidhttp://example.com, @@ -5711,7 +5717,7 @@ Plain ''italic'''s plain ### ### Tables ### -### some content taken from http://meta.wikimedia.org/wiki/MediaWiki_User's_Guide:_Using_tables +### some content taken from http://meta.wikimedia.org/wiki/MediaWiki_User%27s_Guide:_Using_tables ### # This should not produce
bar @@ -6250,12 +6256,19 @@ Table cell attributes: Pipes protected by nowikis should be treated as a plain c | title="foo|" bar |
bar | +bar | +title="foo|" bar |
" onmouseover="alert(document.cookie)">test |
foo | |
style="color: red !important;" data-contrived="put this here | foo |
[[[Main Page]]] +Foo [[[Main Page]]]
!! end @@ -7368,7 +7402,7 @@ Link containing double-single-quotes '' (bug 4598) !! wikitext [[Lista d''e paise d''o munno]] !! html/php - !! html/parsoid @@ -7405,10 +7439,10 @@ Link with double quotes in title part (literal) and alternate part (interpreted) [[''Pentecoste''|''Pentecoste'']] !! html/php -File:Denys Savchenko Pentecoste.jpg -
File:Denys Savchenko Pentecoste.jpg +
!! html/parsoid @@ -13838,9 +13872,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}}]] @@ -13851,6 +13885,30 @@ T93580: Templated inside imagesCategory:MediaWiki User's Guide +
Category:MediaWiki User's Guide
!! end @@ -14044,7 +14102,7 @@ cat !! wikitext [[Category:MediaWiki User's Guide]] !! html -MediaWiki User's Guide +MediaWiki User's Guide !! end !! test @@ -14063,7 +14121,7 @@ cat !! wikitext [[Category:MediaWiki User's Guide|Foo]] !! html -MediaWiki User's Guide +MediaWiki User's Guide !! end !! test @@ -14073,7 +14131,7 @@ cat !! wikitext [[Category:MediaWiki User's Guide|MediaWiki User's Guide]] !! html -MediaWiki User's Guide +MediaWiki User's Guide !! end !! test @@ -15851,6 +15909,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 @@ -19025,7 +19084,7 @@ language=sr cat !! wikitext [[Category:ÐедиаWики УÑеÑ'Ñ ÐÑиде]] !! html -MediaWiki User's Guide +MediaWiki User's Guide !! end @@ -20673,14 +20732,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/phpcaption
@@ -21889,23 +21957,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=
- -=fooa=
!!end # New headings and existing headings are handled differently @@ -21962,15 +22030,26 @@ parsoid=html2wt !! test Headings: 3. Nested inside html with wikitext split by html tags !! options -parsoid=html2wt,wt2wt -!! wikitext -= ='''bold'''=a=
+ +=a=
+ +=a=
!! wikitext=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
-=a= -b -
=a= -b -
=a= -b -
=a= +
=a= +b
+!! wikitext +=a= -b
- -=a= -b
-=a= -b
+=a= -b
+a +=b=
!! wikitext aa -=b= -
-!! html/parsoid -a -=b= !!end !! test Headings: 6d. Heading chars in SOL context (with interspersed comments) +!! options +parsoid=html2wt +!! html/parsoid +
=a=
+ +=a=
!! wikitext=a= -
=a= -
-!! html/parsoid -=a=
- -=a=
!!end !! test @@ -22176,27 +22222,36 @@ a !! test Lists: 0. Outside nests +!! options +parsoid=html2wt +!! html/parsoid +*foo
+ +#foo
+ +;Foo:bar
!! wikitext*foo -
#foo -
;Foo:bar -
-!! html/parsoid -*foo
- -#foo
- -;Foo:bar
+a *b
+!! wikitext +a +----
-=foo=
-*foo
!! end #### --------------- Tables --------------- @@ -22386,40 +22438,48 @@ HRs: 1. Single line !! test Tables: 1a. Simple example -!! wikitext -{| |}
+!! wikitext +!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 @@ -22480,11 +22540,8 @@ parsoid=html2wt !! test Tables: 2c. Nested in td -- no escaping needed -!! wikitext -{| - -|foo!!bar -|} +!! options +parsoid=html2wt !! html/*foo!!bar |
foo!bar |
---|
foo-bar | foo+bar |
foo-bar | foo+bar |
foo
+ bar|baz ++bar +-bar | |
x
+ a|b |
+
foo-bar | foo+bar |
foo-bar | foo+bar |
foo
- bar|baz -+bar --bar | |
x
- a|b |
-
Foo-bar | ++1 | +-2 |
Foo-bar | -+1 | --2 |
<foo | +bar> |
<foo | -bar> |
Fooboo +[Foobar] +x [Foobar] x
!! wikitext [[Foo|Foo''boo'']] [[Foo|[Foobar]]] @@ -22764,10 +22823,6 @@ Links 1. WikiLinks: No escapes needed [Foobar] x [Foobar] x -!! html/parsoid -Fooboo -[Foobar] -x [Foobar] x
!! end !! test @@ -22812,6 +22867,11 @@ parsoid=html2wt !! test Links 3. WikiLinks: No escapes needed +!! options +parsoid=html2wt +!! html/parsoid + !! wikitext [[Foo|[Foobar]] [[Foo|foo|bar]] @@ -22819,9 +22879,6 @@ Links 3. WikiLinks: No escapes needed -!! html/parsoid - !! end !! test @@ -22851,17 +22908,21 @@ parsoid=html2wt !! test Links 5. ExtLinks: No escapes needed +!! options +parsoid=html2wt +!! html/parsoid + !! wikitext [http://google.com [google] !! html/php -!! html/parsoid - !! end !! test Links 6. Addxhttp://example.comy
http://example.com?x
@@ -22895,6 +22956,8 @@ http://example.com(x
x
http://example.com
@@ -22928,6 +22991,8 @@ y
!! test
Links 7b. Don't add spurious
http://example.com.,;:!?\ -http://example.com:
@@ -22942,6 +23007,8 @@ http://example.com.,;:!?\ !! test Links 8. AddRFC 1234
RFC 123y
@@ -22954,6 +23021,8 @@ X
RFC 123?foo
RFC 123&foo
@@ -22972,6 +23041,8 @@ RFC 123&foo
!! test
Links 10. Add
PMID 1234
PMID 123y
@@ -22984,6 +23055,8 @@ X
PMID 123?foo
PMID 123&foo
@@ -23002,6 +23075,8 @@ PMID 123&foo
!! test
Links 12. Add
ISBN 12345678901
ISBN 1234567890x
@@ -23015,6 +23090,8 @@ a
-ISBN 1234567890's !! wikitext @@ -23039,13 +23116,14 @@ parsoid=html2wt Links 15. Link trails can't become link prefixes. !! options language=is +parsoid=html2wt +!! html/parsoid +
!! wikitext [[Söfnuður]]-[[00]] !! html/php -!! html/parsoid - !! end #### --------------- Quotes --------------- @@ -23057,28 +23135,7 @@ language=is !! test 1a. Quotes inside and !! options -parsoid=html2wt,wt2wt -!! wikitext -'''foo' ''foo'' @@ -23101,22 +23158,34 @@ a|!*#-:;+-~[]{}b'''x'' 'foo bar 'baz a|!*#-:;+-~[]{}b'x
+!! wikitext +''[[foohello]]
+[[foohello]]
!! wikitext [[''foo''[[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]] -
[[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 --------------- @@ -23174,6 +23256,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 barbar [[foo]] -
=bar [[foo]] -
[[bar [[foo]] -
]]bar [[foo]] -
=bar foo]]= -
!!end #### ----------------------- PRE -------------------------- @@ -23199,20 +23283,7 @@ bara -
a -
a(tab) -
a - a -
a - b -
a - b -
a - b -
+parsoid=html2wt !! html/parsoida
@@ -23251,51 +23322,64 @@ a a 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 -foo [1]
+-!! html +!! wikitexta 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/parsoida b - c
+ c
* foo * bar+!! wikitext + * foo + * bar !! end #### --------------- Behavior Switches -------------------- @@ -23351,15 +23435,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 @@ -23369,6 +23446,15 @@ __TOC__ bar
foo
bar+!! wikitext + __TOC__ + + + __TOO__ + + __TOC__ foo + +__TOC__ bar !! end #### --------------- HTML tags --------------- @@ -23380,75 +23466,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 -*
<div >foo</div >
+!! wikitext +<ref>foo</ref> +
<ref>bar +
baz</ref> +
!! wikitext<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