Copy changes from legacyMediaParserTests to mediaParserTests after syncing

From I41eb89f9a4caddce7f90f8c8b92b4fcb29eb4539

Change-Id: I24835feed2b17c2091729657c6c0c34f3ee31b78
This commit is contained in:
Arlo Breault 2021-06-25 11:01:27 -04:00
parent 354a366f31
commit ce7df5f6ea

View file

@ -2930,7 +2930,7 @@ parsoid={
!! html/parsoid
<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","body":{}}'>
<li class="gallerycaption">123</li>
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span>File:Test.png</span></div><div class="gallerytext"></div></li>
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Test.png"><span resource="./File:Test.png" data-width="120" data-height="120">File:Test.png</span></a></span></div><div class="gallerytext"></div></li>
</ul>
!! wikitext
<gallery caption="123">
@ -3795,3 +3795,40 @@ wgParserEnableLegacyMediaDOM=false
!! html/parsoid
<figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="./File:Thumb.png"><img resource="./File:Thumb.png" src="http://example.com/images/e/ea/Thumb.png" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135"/></a><figcaption></figcaption></figure>
!! end
## The bogus option here isn't going to roundtrip
!! test
File with caption with pipe in extension tag attribute
!! options
parsoid=wt2html,html2html
!! config
wgParserEnableLegacyMediaDOM=false
!! wikitext
[[File:Foobar.jpg|thumb|Test <nowiki bogus="attri|bute"/> 123]]
!! html/php
<figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="/wiki/File:Foobar.jpg"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a><figcaption>Test 123</figcaption></figure>
!! html/parsoid
<figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="25" width="220" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/330px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/440px-Foobar.jpg 2x"/></a><figcaption>Test <span typeof="mw:Nowiki"></span> 123</figcaption></figure>
!! end
!! test
File with table in caption with extra table attribute spaces
!! config
wgParserEnableLegacyMediaDOM=false
!! wikitext
[[File:Foobar.jpg|thumb|
{|
|-
|hi
|}
]]
!! html/php
<figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="/wiki/File:Foobar.jpg"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a><figcaption><table> <tbody><tr> <td>hi </td></tr></tbody></table></figcaption></figure>
!! html/parsoid
<figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="25" width="220" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/330px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/440px-Foobar.jpg 2x"/></a><figcaption>
<table>
<tbody><tr data-parsoid='{"startTagSrc":"|-"}'>
<td>hi</td></tr>
</tbody></table>
</figcaption></figure>
!! end