X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fparser%2FparserTests.txt;h=dc7cafbc0ca10f455b66a7f59d3412b2a7d1b9d5;hb=43b0016bd485da2aba2532b4bc25a89d4bc6f61d;hp=bbd9ecbe990e3be641ebb056233b54b8918876ad;hpb=7c091e68e9e9f8dcc5c09353671566f24719009b;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index bbd9ecbe99..dc7cafbc0c 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -37,7 +37,7 @@ # You can also set the following parser properties via test options: # wgEnableUploads, wgAllowExternalImages, wgMaxTocLevel, # wgLinkHolderBatchSize, wgRawHtml, wgInterwikiMagic, -# wgEnableMagicLinks +# wgEnableMagicLinks, wgMediaInTargetLanguage # # For testing purposes, temporary articles can created: # !!article / NAMESPACE:TITLE / !!text / ARTICLE TEXT / !!endarticle @@ -56,6 +56,12 @@ Foo FOO !!endarticle +!!article +Foo''s bar''s +!!text +Article titles can contain single quotes! +!!endarticle + !!article Template:Foo !!text @@ -8022,6 +8028,31 @@ Link containing an equals sign

Special:BookSources/isbn=4-00-026157-6

!! end +!! article +Foo & bar +!! text +Just a test of an article title containing an ampersand +!! endarticle + +!! test +Link containing an ampersand +!! wikitext +[[Foo & bar]] + +[[Foo & bar]] + +[[Foo & bar]] +!! html/php+tidy +

Foo & bar +

Foo & bar +

[[Foo & bar]] +

+!! html/parsoid +

Foo & bar

+

Foo & bar

+

[[Foo & bar]]

+!! end + !! article Foo~bar !! text @@ -15001,6 +15032,321 @@ Alt image option should handle most kinds of wikitext without barfing
This is a link and a bold template.
This is the image caption
!! end +!! test +Ampersand in alt attribute (T206940) +!! wikitext +[[File:Foobar.jpg|alt=&]] + + + +File:Foobar.jpg|alt=& + +!! html/php+tidy +

& +

+ +!! html/parsoid +

&

+ + + +!! end + +!! test +Italics markup in alt attribute (T206940) +!! wikitext +[[File:Foobar.jpg|alt=''x''|caption]] + + + +File:Foobar.jpg|alt=''x''|caption + +!! html/php+tidy +

x +

+ +!! html/parsoid +

x

+ + + +!! end + +!! test +Nowiki markup in alt attribute (T206940) +!! wikitext +[[File:Foobar.jpg|alt=''x''|caption]] + + + +File:Foobar.jpg|alt=''x''|caption + +!! html/php+tidy +

''x'' +

+ +!! html/parsoid +

''x''

+ + + +!! end + +!! test +Nowiki markup in alt attribute (edited html, no data-parsoid) (T206940) +!! wikitext +[[File:Foobar.jpg|alt=''x''|caption]] + + + +File:Foobar.jpg|alt=''x''|caption + +!! html/php+tidy +

''x'' +

+ +!! html/parsoid +

''x''

+ + + +!! end + +!! test +Ampersand in link attribute (T206940) +!! wikitext +[[File:Foobar.jpg|link=Foo & bar]] + + + +File:Foobar.jpg|link=Foo & bar + +!! html/php+tidy +

Foobar.jpg +

+ +!! html/parsoid +

+ + + +!! end + +!! test +Ampersand in link attribute (edited html, no data-parsoid) (T206940) +!! wikitext +[[File:Foobar.jpg|link=Foo_&_bar]] + + + +File:Foobar.jpg|link=Foo_&_bar + +!! html/php+tidy +

Foobar.jpg +

+ +!! html/parsoid +

+ + + +!! end + +!! test +Italics markup in link attribute (T206940) +!! wikitext +[[Foo''s bar''s]] + + +[[File:Foobar.jpg|link=Foo''s bar''s|caption1]] + +[[File:Foobar.jpg|link=''Main Page''|caption2]] + + + +File:Foobar.jpg|link=Foo''s bar''s|caption1 +File:Foobar.jpg|link=''Main Page''|caption2 + +!! html/php+tidy +

Foo''s bar''s +

caption1 +

caption2 +

+ +!! html/parsoid +

Foo''s bar''s

+ + +

+ +

+ + + +!! end + +!! test +Nowiki markup in link attribute (T206940) +!! wikitext +[[File:Foobar.jpg|link=Foo''s_bar''s|caption]] + + + +File:Foobar.jpg|link=Foo''s_bar''s|caption + +!! html/php+tidy +

caption +

+ +!! html/parsoid +

+ + + +!! end + +!! test +Nowiki markup in link attribute (edited html, no data-parsoid) (T206940) +!! wikitext +[[File:Foobar.jpg|link=Foo''s_bar''s|caption]] + + + +File:Foobar.jpg|link=Foo''s_bar''s|caption + +!! html/php+tidy +

caption +

+ +!! html/parsoid +

+ + + +!! end + !! test Image with table with attributes in caption !! options @@ -15370,6 +15716,30 @@ parsoid=wt2html,wt2wt,html2html
lang=invalid:language:code
!! end +!! test +SVG thumbnails in page language +!! options +language=ru +wgMediaInTargetLanguage = true +!! wikitext +[[File:Foobar.svg]] [[File:Foobar.svg|lang=en]] +!! html/php +

Foobar.svg Foobar.svg +

+!! end + +!! test +SVG thumbnails in page language not present in the file +!! options +language=de +wgMediaInTargetLanguage = true +!! wikitext +[[File:Foobar.svg]] [[File:Foobar.svg|lang=ru]] +!! html/php +

Foobar.svg Foobar.svg +

+!! end + !! test T3887: A ISBN with a thumbnail !! wikitext @@ -21728,6 +22098,8 @@ wgRawHtml=1 !! html/php

+!! html/parsoid +

!! end !! test @@ -24865,9 +25237,30 @@ __TOC__

Style[edit]

+!! html/parsoid + +

Style

+!! end + +!! test +T198618: script element in ToC +!! options +wgRawHtml=1 +!! wikitext +__TOC__ +==Script== +!! html/php +

Contents

+ +
+ +

Script[edit]

+ !! html/parsoid -

Style

+

Script

!! end !! test @@ -30004,15 +30397,14 @@ parsoid={ "modes": ["selser"], "scrubWikitext": true, "changes": [ - [ "#x", "after", "

\n

x

"] + [ "#x", "after", "

\n

bar

"] ] } !! wikitext -foo +
foo
!! wikitext/edited -foo - -x +
foo
+bar !! end !! test @@ -30664,8 +31056,18 @@ styletag=1 +!! html/parsoid +
+ + +
!! end +## Right now, Parsoid doesn't de-duplicate style tags. +## So, we shouldn't see link tags that need to bypass the sanitizer. +## In a followup patch, when we de-duplicate style tags and +## introduce link tags, we'll add a hook for link tags in +## the parser test runner script. !! test Validating that bar

+!! html/parsoid +

A style tag, by itself or with other style/link tags, shouldn't be wrapped in a paragraph

+ + + +

<link rel="foo" href="bar"/>

+ +

But if it's on a line with other content, let it be wrapped.

+ +

bar

+ +

foo

+ +

foo bar

+ +

And the same if we have non-paragraph-breaking whitespace

+ +

foo + +bar

!! end !! test @@ -30746,6 +31168,24 @@ bar

!! end +!! test +Extension returning multiple nodes starting with a style tag roundtrips +!! options +wgRawHtml=1 +!! wikitext + +{{echo| +}} + +
ho
+!! html/parsoid +

+

+ + +
ho
+!! end + !! test Decoding of HTML entities in headings and links for IDs and link fragments (T103714) !! config