From 335669755d0539ac304270f19c44f9e109bd616b Mon Sep 17 00:00:00 2001 From: Isabelle Hurbain-Palatin Date: Wed, 29 Sep 2021 16:09:15 +0200 Subject: [PATCH] Sync up with Parsoid mediaParserTests.txt This now aligns with Parsoid commit 4bd0707f974b664cef5de5c8c54a5f31520bd4df Change-Id: I016d67683c431a47296d29db6577cd7dc601bc9b --- tests/parser/mediaParserTests.txt | 526 +++++++++++++++++++++----------------- 1 file changed, 293 insertions(+), 233 deletions(-) diff --git a/tests/parser/mediaParserTests.txt b/tests/parser/mediaParserTests.txt index f79b199f69d..74331bd4138 100644 --- a/tests/parser/mediaParserTests.txt +++ b/tests/parser/mediaParserTests.txt @@ -55,7 +55,7 @@ wgParserEnableLegacyMediaDOM=false

Foobar.jpg

!! html/parsoid -

+

!! end !! test @@ -63,7 +63,7 @@ Serialize simple image with figure-inline wrapper !! options parsoid=html2wt !! html/parsoid -

+

!! wikitext [[File:Foobar.jpg]] !! end @@ -78,7 +78,7 @@ wgParserEnableLegacyMediaDOM=false

Foobar.jpg

!! html/parsoid -

+

!! end !! test @@ -90,7 +90,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
Foobar.jpg
!! html/parsoid -
+
!! end !! test @@ -102,7 +102,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
Caption text
Caption text
!! html/parsoid -
Caption text
+
Caption text
!! end !! test @@ -114,7 +114,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
Caption page stuff
Caption page stuff
!! html/parsoid -
Caption page stuff
+
Caption page stuff
!! end !! test @@ -126,7 +126,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
Caption page=
Caption page=
!! html/parsoid -
Caption page=
+
Caption page=
!! end !! test @@ -138,7 +138,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
Caption page=stuff
Caption page=stuff
!! html/parsoid -
Caption page=stuff
+
Caption page=stuff
!! end !! test @@ -152,8 +152,8 @@ wgParserEnableLegacyMediaDOM=false
one | two
one two | three
!! html/parsoid -
one | two
-
one two | three
+
one | two
+
one two | three
!! end !! test @@ -170,7 +170,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
Caption Link1 [[]] Link2
!! html/parsoid -
Caption Link1 +
Caption Link1 [[]] Link2
@@ -186,7 +186,7 @@ wgParserEnableLegacyMediaDOM=false

stuff

!! html/parsoid -

+

!! end !! test @@ -208,7 +208,7 @@ Linktrails should not work for images: [[File:Foobar.jpg]]s

Linktrails should not work for images: Foobar.jpgs

!! html/parsoid -

Linktrails should not work for images: s

+

Linktrails should not work for images: s

!! end !! test @@ -222,7 +222,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
Caption text
Caption text
!! html/parsoid -
Caption text
+
Caption text
!! end !! test @@ -234,7 +234,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
This is a caption
!! html/parsoid -
This is a caption
+
This is a caption
!! end !! test @@ -246,7 +246,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
This is a caption
!! html/parsoid -
This is a caption
+
This is a caption
!! end !! test @@ -259,7 +259,7 @@ wgParserEnableLegacyMediaDOM=false

Foobar.jpg

!! html/parsoid -

+

!! end ## Parsoid does not provide editing support for images where templates produce multiple image attributes. @@ -273,7 +273,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
Caption text
Caption text
!! html/parsoid -
Caption text
+
Caption text
!! end !! test @@ -297,9 +297,9 @@ wgParserEnableLegacyMediaDOM=false 123

Foobar.jpg

456 123

Foobar.jpg

456

!! html/parsoid -

123456

-

123

456 -123

+

123456

+

123

456 +123

456

!! end @@ -312,7 +312,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
Caption3 - accepted
Caption3 - accepted
!! html/parsoid -
Caption3 - accepted
+
Caption3 - accepted
!! end !! test @@ -325,7 +325,7 @@ wgParserEnableLegacyMediaDOM=false

caption

!! html/parsoid -

+

!! end !! test @@ -343,8 +343,8 @@ wgParserEnableLegacyMediaDOM=false

caption

!! html/parsoid -
caption
-

+
caption
+

!! end !! test @@ -360,9 +360,9 @@ wgParserEnableLegacyMediaDOM=false
Caption
Caption
Caption
Caption
!! html/parsoid -
Caption
-
Caption
-
Caption
+
Caption
+
Caption
+
Caption
!! end # a sad bit of backward-compatibility @@ -380,7 +380,7 @@ wgParserEnableLegacyMediaDOM=false Foobar.jpg

!! html/parsoid -

+

!! end !! test @@ -393,7 +393,7 @@ wgParserEnableLegacyMediaDOM=false

Foobar.jpg

!! html/parsoid -

+

!! end # parsoid T51293 (part 1) @@ -407,7 +407,7 @@ wgParserEnableLegacyMediaDOM=false

Foobar.jpg

!! html/parsoid -

+

!! end # parsoid T51293 (part 2) @@ -421,7 +421,7 @@ wgParserEnableLegacyMediaDOM=false

Foobar.jpg

!! html/parsoid -

+

!! end !! test @@ -499,7 +499,7 @@ wgParserEnableLegacyMediaDOM=false

Foobar.jpg

!! html/parsoid -

+

!! end !! test @@ -512,7 +512,7 @@ wgParserEnableLegacyMediaDOM=false

Title

!! html/parsoid -

+

!! end !! test @@ -525,7 +525,7 @@ wgParserEnableLegacyMediaDOM=false

Title

!! html/parsoid -

+

!! end !! test @@ -540,7 +540,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
Title
!! html/parsoid -
Title
+
Title
!! end !! test @@ -554,7 +554,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
Title
!! html/parsoid -
Title
+
Title
!! end !! test @@ -569,7 +569,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
Title
!! html/parsoid -
Title
+
Title
!! end !! test @@ -584,7 +584,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
Title
!! html/parsoid -
Title
+
Title
!! end !! test @@ -599,7 +599,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
Title
!! html/parsoid -
Title
+
Title
!! end !! test @@ -614,7 +614,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
Title
!! html/parsoid -
Title
+
Title
!! end !! test @@ -629,7 +629,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
alttext
Title
!! html/parsoid -
alttext
Title
+
alttext
Title
!! end !! test @@ -643,7 +643,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
This is a test image Main Page
!! html/parsoid -
This is a test image Main Page
+
This is a test image Main Page
!! end !! test @@ -657,7 +657,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
Altitude
This is a test image Main Page
!! html/parsoid -
Altitude
This is a test image Main Page
+
Altitude
This is a test image Main Page
!! end !! test @@ -673,9 +673,9 @@ wgParserEnableLegacyMediaDOM=false

testing bold in alt

!! html/parsoid -

+

-

testing bold in alt

+

testing bold in alt

!! end !! test @@ -687,7 +687,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
This is a link and a bold template.
This is the image caption
!! html/parsoid -
This is a link and a bold template.
This is the image caption
+
This is a link and a bold template.
This is the image caption
!! end !! test @@ -712,12 +712,12 @@ File:Foobar.jpg|alt=& !! html/parsoid -

&

+

&

@@ -759,14 +759,14 @@ File:Foobar.jpg|alt=http://testing.123?4=5|6|caption !! html/parsoid -

http://testing.123?4=5|6

+

http://testing.123?4=5|6

-

http://testing.123?4=5|6

+

http://testing.123?4=5|6

!! end @@ -797,11 +797,11 @@ File:Foobar.jpg|alt=''x''|caption !! html/parsoid -

x

+

x

@@ -835,12 +835,12 @@ File:Foobar.jpg|alt=''x''|caption !! html/parsoid -

''x''

+

''x''

@@ -870,12 +870,12 @@ File:Foobar.jpg|alt=''x''|caption !! html/parsoid -

''x''

+

''x''

!! end @@ -906,12 +906,12 @@ File:Foobar.jpg|link=Foo & bar !! html/parsoid -

+

@@ -939,12 +939,12 @@ File:Foobar.jpg|link=Foo_&_bar !! html/parsoid -

+

@@ -994,18 +994,18 @@ File:Foobar.jpg|link=''Main Page''|caption2

Foo''s bar''s

-

+

-

+

@@ -1039,12 +1039,12 @@ File:Foobar.jpg|link=Foo''s_bar''s|caption !! html/parsoid -

+

@@ -1074,12 +1074,12 @@ File:Foobar.jpg|link=Foo''s_bar''s|caption !! html/parsoid -

+

@@ -1107,12 +1107,12 @@ File:Foobar.jpg|link=https://example.com?foo¶ms=bar !! html/parsoid -

+

@@ -1126,7 +1126,7 @@ language=sr !! wikitext [[Датотека:Foobar.jpg]] !! html/parsoid -

+

!! end !! test @@ -1141,7 +1141,7 @@ parsoid=wt2html,html2html |} ]] !! html/parsoid -
+
@@ -1158,7 +1158,7 @@ Image with table with rows from templates in caption |} ]] !! html/parsoid -
+
ha
hi
@@ -1177,7 +1177,7 @@ Image with nested tables in caption |} ]] !! html/parsoid -
Foo
+
Foo
@@ -1200,7 +1200,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php

Testing[edit]

123
!! html/parsoid -
+

Testing

123
@@ -1230,9 +1230,9 @@ wgParserEnableLegacyMediaDOM=false

caption

!! html/parsoid -

-

-

+

+

+

!! end !! test @@ -1250,9 +1250,9 @@ wgParserEnableLegacyMediaDOM=false
caption
caption
!! html/parsoid -
caption
-
caption
-
caption
+
caption
+
caption
+
caption
!! end !! test @@ -1270,9 +1270,9 @@ wgParserEnableLegacyMediaDOM=false
caption
caption
!! html/parsoid -
caption
-
caption
-
caption
+
caption
+
caption
+
caption
!! end ################### @@ -1302,8 +1302,8 @@ wgParserEnableLegacyMediaDOM=false

Foobar.jpg

!! html/parsoid -

-

+

+

!! end !! test @@ -1321,8 +1321,8 @@ wgParserEnableLegacyMediaDOM=false

Foobar.jpg

!! html/parsoid -

-

+

+

!! end !! test @@ -1336,7 +1336,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
Foobar.jpg
!! html/parsoid -
+
!! end !! test @@ -1353,8 +1353,8 @@ wgParserEnableLegacyMediaDOM=false
Foobar.jpg
Foobar.svg
!! html/parsoid -
-
+
+
!! end !! test @@ -1369,7 +1369,7 @@ wgParserEnableLegacyMediaDOM=false

Foobar.jpg

!! html/parsoid -

+

!! end !! test @@ -1387,8 +1387,8 @@ wgParserEnableLegacyMediaDOM=false

Foobar.svg

!! html/parsoid -

-

+

+

!! end !! test @@ -1411,10 +1411,10 @@ wgParserEnableLegacyMediaDOM=false
Foobar.jpg
Foobar.jpg
!! html/parsoid -
-
-
-
+
+
+
+
!! end !! test @@ -1422,8 +1422,8 @@ Bogus sizes during html2wt !! options parsoid=html2wt !! html/parsoid -

-

+

+

!! wikitext [[File:Foobar.jpg]] @@ -1462,7 +1462,7 @@ wgParserEnableLegacyMediaDOM=false

http://example.com

!! html/parsoid -

+

!! end !! test @@ -1476,7 +1476,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
http://example.com
!! html/parsoid -
http://example.com
+
http://example.com
!! end !! test @@ -1491,7 +1491,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
Alteration
http://example.com
!! html/parsoid -
Alteration
http://example.com
+
Alteration
http://example.com
!! end !! test @@ -1503,7 +1503,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
caption
!! html/parsoid -
caption
+
caption
!! end !! test @@ -1517,7 +1517,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
caption
!! html/parsoid -
caption
+
caption
!! end !! test @@ -1531,7 +1531,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
lang=invalid:language:code
!! html/parsoid -
lang=invalid:language:code
+
lang=invalid:language:code
!! end !! test @@ -1569,7 +1569,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
ISBN 1235467890
!! html/parsoid -
ISBN 1235467890
+
ISBN 1235467890
!! end !! test @@ -1581,7 +1581,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
This is RFC 12354
!! html/parsoid -
This is RFC 12354
+
This is RFC 12354
!! end !! test @@ -1593,7 +1593,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
Please mailto:nobody@example.com
!! html/parsoid -
Please mailto:nobody@example.com
+
Please mailto:nobody@example.com
!! end # Pending resolution to T2368 @@ -1607,7 +1607,7 @@ wgParserEnableLegacyMediaDOM=false

text with a link in it

!! html/parsoid -

+

!! end !! test @@ -1620,7 +1620,7 @@ wgParserEnableLegacyMediaDOM=false

text with a linkfoo in it

!! html/parsoid -

+

!! end !! test @@ -1633,7 +1633,7 @@ wgParserEnableLegacyMediaDOM=false

text with a MeatBall:Link in it

!! html/parsoid -

+

!! end !! test @@ -1646,7 +1646,7 @@ wgParserEnableLegacyMediaDOM=false

text with a link in it

!! html/parsoid -

+

!! end !! test @@ -1654,7 +1654,7 @@ T107474: Frameless image caption with !! wikitext [[File:Foobar.jpg|text with a [[MeatBall:Link|link]] in it]] !! html/parsoid -

+

!! end !! test @@ -1667,7 +1667,7 @@ wgParserEnableLegacyMediaDOM=false

& < > "

!! html/parsoid -

+

!! end !! test @@ -1682,7 +1682,7 @@ wgParserEnableLegacyMediaDOM=false

& < > "

!! html/parsoid -

+

!! end !! test @@ -1708,7 +1708,7 @@ wgParserEnableLegacyMediaDOM=false

♀

!! html/parsoid -

+

!! end !! test @@ -1733,7 +1733,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
This is a caption with another image inside it!
!! html/parsoid -
This is a caption with another inside it!
+
This is a caption with another inside it!
!! end !! test @@ -1747,7 +1747,7 @@ wgParserEnableLegacyMediaDOM=false

This *is some text

!! html/parsoid -

+

!!end ## The leading space should not trigger nowiki escaping in wt2wt mode @@ -1760,7 +1760,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
bar
!! html/parsoid -
bar
+
bar
!!end # html/php output not have newlines after table, td, th, etc. because @@ -1784,7 +1784,7 @@ and some more text.]] !! html/php
This is an example image thumbnail caption with a table
Foo Bar
Foo1 Bar1
and some more text. !! html/parsoid -
This is an example image thumbnail caption with a table +
This is an example image thumbnail caption with a table @@ -1802,7 +1802,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
This caption has irc and Secure ext links in it.
!! html/parsoid -
This caption has irc and Secure ext links in it.
+
This caption has irc and Secure ext links in it.
!! end !! test @@ -1817,7 +1817,7 @@ wgParserEnableLegacyMediaDOM=false

a

!! html/parsoid -

+

!! end !! test @@ -1832,7 +1832,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
caption
caption
!! html/parsoid -
caption
+
caption
!! end !! test @@ -1848,7 +1848,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
caption
!! html/parsoid -
caption
+
caption
!! end !! test @@ -1857,7 +1857,7 @@ Localized image handling (3). language=fa parsoid=html2wt !! html/parsoid -
+
!! wikitext [[File:Foobar.jpg|بندانگشتی]] !! end @@ -1875,7 +1875,7 @@ wgParserEnableLegacyMediaDOM=false

caption

!! html/parsoid -

+

!! end # Note that 'right' is the default alignment, despite the misspelled 'righ' below @@ -1897,9 +1897,9 @@ wgParserEnableLegacyMediaDOM=false
caption
caption
!! html/parsoid -
caption
-
caption
-
caption
+
caption
+
caption
+
caption
!! end !! article @@ -1949,7 +1949,7 @@ Parsoid-specific image handling - simple image with size and middle alignment !! wikitext [[File:Foobar.jpg|middle|50px]] !! html/parsoid -

+

!! end !! test @@ -1959,7 +1959,7 @@ parsoid=wt2wt,wt2html,html2html !! wikitext [[Image:Foobar.jpg|middle|50px]] !! html/parsoid -

+

!! end !! test @@ -1967,7 +1967,7 @@ Parsoid-specific image handling - simple image with size and middle alignment (e !! wikitext [[File:Foobar.jpg|50px|middle]] !! html/parsoid -

+

!! end !! test @@ -1977,7 +1977,7 @@ parsoid=wt2html,wt2wt,html2html !! wikitext [[Image:Foobar.jpg|50px|middle]] !! html/parsoid -

+

!! end !! test @@ -1985,7 +1985,7 @@ Parsoid-specific image handling - simple image with both sizes, a baseline align !! wikitext [[File:Foobar.jpg|500x10px|baseline|caption]] !! html/parsoid -

+

!! end !! test @@ -1993,7 +1993,7 @@ Parsoid-specific image handling - simple image with border and size spec !! wikitext [[File:Foobar.jpg|50px|border|caption]] !! html/parsoid -

+

!! end !! test @@ -2003,7 +2003,7 @@ parsoid=wt2html,html2html !! wikitext [[File:Foobar.jpg|left|baseline|thumb|caption content]] !! html/parsoid -
caption content
+
caption content
!! end !! test @@ -2013,7 +2013,7 @@ parsoid=wt2html,html2html !! wikitext [[File:Foobar.jpg|thumb|left|baseline|caption content]] !! html/parsoid -
caption content
+
caption content
!! end !! test @@ -2023,7 +2023,7 @@ parsoid=wt2html,html2html !! wikitext [[Image:Foobar.jpg|right|middle|thumb|50x50px|caption]] !! html/parsoid -
caption
+
caption
!! end !! test @@ -2033,7 +2033,7 @@ parsoid=wt2html,html2html !! wikitext [[File:Foobar.jpg|thumb|50x50px|right|middle|caption]] !! html/parsoid -
caption
+
caption
!! end !! test @@ -2043,7 +2043,7 @@ parsoid=wt2html,wt2wt,html2html !! wikitext [[File:Foobar.jpg|frame|500x50px|caption]] !! html/parsoid -
caption
+
caption
!! end !! test @@ -2053,7 +2053,7 @@ parsoid=wt2html,html2html !! wikitext [[File:Foobar.jpg|left|baseline|frame|500x50px|caption]] !! html/parsoid -
caption
+
caption
!! end !! test @@ -2061,7 +2061,7 @@ Parsoid-specific image handling - frameless image with specific size, border, an !! wikitext [[File:Foobar.jpg|frameless|442x50px|border|caption]] !! html/parsoid -

+

!! end !! test @@ -2069,7 +2069,7 @@ Parsoid-specific image handling - simple image with a formatted caption !! wikitext [[File:Foobar.jpg|
FooBar
ab
c
]] !! html/parsoid -

+

!! end !! test @@ -2077,7 +2077,7 @@ Parsoid-specific image handling - caption with a template in it !! wikitext [[File:Foobar.jpg|thumb|200x23px|This caption has a {{1x|transclusion}} in it.]] !! html/parsoid -
This caption has a transclusion in it.
+
This caption has a transclusion in it.
!! end !! test @@ -2090,7 +2090,7 @@ foo bar !! html/parsoid

foo

-
This caption has a
unbalanced tag in it.
+
This caption has a
unbalanced tag in it.

bar

!! end @@ -2101,7 +2101,7 @@ parsoid=wt2html,wt2wt !! wikitext [[File:Foobar.jpg|thumb|]] !! html/parsoid -
+
!! end # empty captions don't get serialized unless we're in the "round trip" case @@ -2114,7 +2114,7 @@ parsoid=html2wt
@@ -2128,7 +2128,7 @@ Parsoid-specific image handling - whitespace caption !! wikitext [[File:Foobar.jpg|thumb| ]] !! html/parsoid -
+
!! end !! test @@ -2139,7 +2139,7 @@ foo bar !! html/parsoid

foo - + bar

!! end @@ -2201,7 +2201,7 @@ wgParserEnableLegacyMediaDOM=false

[[Test|Foobar.jpg]]

!! html/parsoid -

[[Test|]]

+

[[Test|]]

!! end !! test @@ -2228,7 +2228,7 @@ http://example.com [[File:Foobar.jpg]]

http://example.com Foobar.jpg

!! html/parsoid -

http://example.com

+

http://example.com

!!end !! test @@ -2241,7 +2241,7 @@ http://example.com[[File:Foobar.jpg]]

http://example.comFoobar.jpg

!! html/parsoid -

http://example.com

+

http://example.com

!! end !! test @@ -2422,9 +2422,9 @@ image:foobar.jpg|Blabla|alt=This is a foo-bar.|blabla.
  • Foo Main Page
  • caption
  • -
  • some caption Main Page
  • -
  • -
  • This is a foo-bar.
    blabla.
  • +
  • some caption Main Page
  • +
  • +
  • This is a foo-bar.
    blabla.
  • !! end @@ -2484,9 +2484,9 @@ image:foobar.jpg|Blabla|alt=This is a foo-bar.|blabla.
  • Foo Main Page
  • caption
  • -
  • some caption Main Page
  • -
  • -
  • This is a foo-bar.
    blabla.
  • +
  • some caption Main Page
  • +
  • +
  • This is a foo-bar.
    blabla.
  • !! end @@ -2508,7 +2508,7 @@ File:Foobar.jpg !! html/parsoid !! end @@ -2530,7 +2530,7 @@ File:Foobar.jpg !! html/parsoid !! end @@ -2570,9 +2570,9 @@ image:foobar.jpg|link=Main Page#section|caption !! html/parsoid !! end @@ -2598,7 +2598,7 @@ File:Foobar.jpg|{{1x|ho}} !! html/parsoid !! end @@ -2631,8 +2631,8 @@ File:Foobar.jpg|Image caption !! html/parsoid !! end @@ -2664,8 +2664,8 @@ File:Foobar.jpg|alt=galleryalt|{{Test|unamedParam|alt=param}} !! html/parsoid !! end @@ -2691,7 +2691,7 @@ File:Foobar.jpg| !! html/parsoid !! end @@ -2743,8 +2743,8 @@ some caption Main Page !! end @@ -2791,8 +2791,8 @@ foobar.jpg !! end @@ -2814,7 +2814,7 @@ File:Foobar.jpg|alt=galleryalt|link=Wikilink !! html/parsoid !! end @@ -2836,7 +2836,7 @@ File:Foobar.jpg|alt=galleryalt|link=http://www.example.org !! html/parsoid !! end @@ -2865,7 +2865,7 @@ File:foobar.jpg|caption|alt=galleryalt|link=http://www.example.org !! html/parsoid !! end @@ -2891,7 +2891,7 @@ File:Foobar.jpg|alt=galleryalt|link=" onclick="alert('malicious javascript code! !! html/parsoid !! end @@ -2917,7 +2917,7 @@ File:Foobar.jpg|link=< !! html/parsoid !! end @@ -2956,7 +2956,7 @@ File:Foobar.jpg !! html/parsoid !! end @@ -2982,7 +2982,7 @@ File:Foobar.jpg|foo !! html/parsoid !! end @@ -3004,7 +3004,7 @@ File:Foobar.jpg !! html/parsoid !! end @@ -3026,7 +3026,7 @@ File:Foobar.jpg !! html/parsoid !! end @@ -3052,7 +3052,7 @@ File:Foobar.jpg|foo !! html/parsoid !! end @@ -3078,7 +3078,7 @@ File:Foobar.jpg|foo !! html/parsoid !! end @@ -3090,8 +3090,8 @@ parsoid={ } !! html/parsoid !! wikitext @@ -3109,7 +3109,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
    Foobar.jpg
    !! html/parsoid -
    +
    !! end !! test @@ -3121,7 +3121,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
    Foobar.jpg
    !! html/parsoid -
    +
    !! end !! test @@ -3134,7 +3134,7 @@ wgParserEnableLegacyMediaDOM=false

    Foobar.jpg

    !! html/parsoid -

    +

    !! end !! test @@ -3147,7 +3147,7 @@ wgParserEnableLegacyMediaDOM=false

    Foobar.jpg

    !! html/parsoid -

    +

    !! end !! test @@ -3160,7 +3160,7 @@ wgParserEnableLegacyMediaDOM=false

    Foobar.jpg

    !! html/parsoid -

    +

    !! end !! test @@ -3173,7 +3173,7 @@ wgParserEnableLegacyMediaDOM=false

    Foobar.jpg

    !! html/parsoid -

    +

    !! end !! test @@ -3191,8 +3191,8 @@ wgParserEnableLegacyMediaDOM=false

    LoremIpsum.djvu

    !! html/parsoid -

    -

    +

    +

    !! end !! test @@ -3207,7 +3207,7 @@ wgParserEnableLegacyMediaDOM=false

    LoremIpsum.djvu

    !! html/parsoid -

    +

    !! end !! test @@ -3263,7 +3263,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
    An external URL
    !! html/parsoid -
    An external URL
    +
    An external URL
    !! end !! test @@ -3277,7 +3277,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
    caption:
    !! html/parsoid -
    +
    !! end !! test @@ -3291,7 +3291,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
    blog (hk: WEBJOURNAL, tw: WEBLOG)
    !! html/parsoid -
    +
    !! end # XXX html2wt disabled because rich markup in alt is not preserved. @@ -3326,8 +3326,8 @@ File:Foobar.jpg|alt=galleryalt|{{Test|unamedParam|alt=-{R|param}-}} !! html/parsoid !! end @@ -3340,7 +3340,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
    hello
    !! html/parsoid -
    hello
    +
    hello
    !! end !! test @@ -3391,7 +3391,7 @@ wgParserEnableLegacyMediaDOM=false

    -
    Test
    +
    Test

    !! end @@ -3410,9 +3410,9 @@ wgParserEnableLegacyMediaDOM=false

    foo

    caption

    bar

    Foobar.jpg
    !! html/parsoid -

    foo

    caption

    bar

    +

    foo

    caption

    bar

    -
    +
    !! end !! test @@ -3426,7 +3426,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php+tidy

    foo

    caption

    bar

    !! html/parsoid -

    foo

    caption

    bar

    +

    foo

    caption

    bar

    !! end !! test @@ -3440,7 +3440,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php+tidy
    Foobar.jpg
    !! html/parsoid -
    +
    !! end !! test @@ -3580,7 +3580,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php+tidy
    bar
    !! html/parsoid -
    bar
    +
    bar
    !! end !! test @@ -3590,7 +3590,7 @@ parsoid=html2wt language=ar disabled !! html/parsoid -
    +
    !! wikitext [[Imagen:Foobar.jpg|derecha|miniaturadeimagen]] !! end @@ -3603,7 +3603,7 @@ Image: Block level image should have \n before and after 456 !! html/parsoid

    123

    -
    +

    456

    !! end @@ -3615,7 +3615,7 @@ Image: New block level image should have \n before and after (existing content) 456 !! html/parsoid

    123

    -
    +

    456

    !! end @@ -3626,9 +3626,9 @@ Image: upright option (parsoid) [[File:Foobar.jpg|thumb|upright=0.5|caption]] [[File:Foobar.jpg|thumb|500x500px|upright=0.5|caption]] !! html/parsoid -
    caption
    -
    caption
    -
    caption
    +
    caption
    +
    caption
    +
    caption
    !! end !! test @@ -3636,7 +3636,7 @@ Image: upright option is ignored on inline and frame images (parsoid) !! wikitext [[File:Foobar.jpg|500x500px|upright=0.5|caption]] !! html/parsoid -

    +

    !! end !! test @@ -3644,7 +3644,7 @@ Image: in template parameter with empty parameter !! wikitext {{1x|[[File:Foobar.jpg|link=]]}} !! html/parsoid -

    +

    !! end !! test @@ -3699,7 +3699,7 @@ wgParserEnableLegacyMediaDOM=false

    link=<

    !! html/parsoid -

    +

    !! end !! test @@ -3718,11 +3718,11 @@ wgParserEnableLegacyMediaDOM=false

    wikipedia:Foo

    !! html/parsoid -

    Main Page

    +

    Main Page

    -

    Media:Thumb.png

    +

    Media:Thumb.png

    -

    wikipedia:Foo

    +

    wikipedia:Foo

    !! end !! test @@ -3740,12 +3740,13 @@ wgParserEnableLegacyMediaDOM=false
    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 +## FIXME: Parsoid isn't recognizing an Interwiki here !! test Interwiki links inside image captions !! options @@ -3757,7 +3758,7 @@ wgParserEnableLegacyMediaDOM=false !! html+tidy
    Wikipedia:Foo bar
    !! html/parsoid -
    Wikipedia:Foo bar
    +
    Wikipedia:Foo bar
    !! end ## Don't necessarily expect this to roundtrip, but run serialization to catch crashers @@ -3779,9 +3780,9 @@ wgParserEnableLegacyMediaDOM=false

    123
    !! html/parsoid -

    +

    -
    123
    +
    123
    !! end !! test @@ -3793,7 +3794,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php+tidy
    Thumb.png
    !! html/parsoid -
    +
    !! end ## The bogus option here isn't going to roundtrip @@ -3808,7 +3809,7 @@ wgParserEnableLegacyMediaDOM=false !! html/php
    Test 123
    !! html/parsoid -
    Test 123
    +
    Test 123
    !! end !! test @@ -3825,10 +3826,69 @@ wgParserEnableLegacyMediaDOM=false !! html/php
    hi
    !! html/parsoid -
    +
    hi
    !! end + +## Expect the media structure to account for cases like this since it's common enough +!! test +File in formatting element violating content model +!! config +wgParserEnableLegacyMediaDOM=false +!! wikitext +

    ''[[File:Foobar.jpg|thumb]]''

    +!! html/php +

    Foobar.jpg

    +!! html/parsoid +

    +!! end + +!! test +Table in figcaption nested in table +!! config +wgParserEnableLegacyMediaDOM=false +!! wikitext +{| +|foo +|[[File:Foobar.jpg|thumb| +{| +|bar +|} +]] +|} +!! html/php + + + +
    foo +
    bar
    +
    +!! html/parsoid + + + +
    foo
    + + +
    bar
    +
    +!! end + +!! test +Files with case sensitive media options +!! config +wgParserEnableLegacyMediaDOM=false +!! wikitext +[[File:Foobar.jpg|thumb|left]] +[[File:Foobar.jpg|thumb|Left]] +!! html/php +
    Foobar.jpg
    +
    Left
    +!! html/parsoid +
    +
    Left
    +!! end -- 2.11.4.GIT