| 1 |
!! options |
| 2 |
version=2 |
| 3 |
parsoid-compatible=wt2html,wt2wt |
| 4 |
!! end |
| 5 |
|
| 6 |
!! article |
| 7 |
Main Page |
| 8 |
!! text |
| 9 |
blah blah |
| 10 |
!! endarticle |
| 11 |
|
| 12 |
!! article |
| 13 |
Foo''s bar''s |
| 14 |
!! text |
| 15 |
Article titles can contain single quotes! |
| 16 |
!! endarticle |
| 17 |
|
| 18 |
!! article |
| 19 |
Template:1x |
| 20 |
!! text |
| 21 |
{{{1}}} |
| 22 |
!! endarticle |
| 23 |
|
| 24 |
!! article |
| 25 |
Template:image_attribs |
| 26 |
!! text |
| 27 |
<noinclude> |
| 28 |
[[File:foobar.jpg|</noinclude>right|Caption text<noinclude>]]</noinclude> |
| 29 |
!! endarticle |
| 30 |
|
| 31 |
!! article |
| 32 |
Template:paramtest |
| 33 |
!! text |
| 34 |
This is a test template with parameter {{{param}}} |
| 35 |
!! endarticle |
| 36 |
|
| 37 |
!! article |
| 38 |
Template:test |
| 39 |
!! text |
| 40 |
This is a test template |
| 41 |
!! endarticle |
| 42 |
|
| 43 |
!! article |
| 44 |
MediaWiki:bad image list |
| 45 |
!! text |
| 46 |
* [[File:Bad.jpg]] except [[Nasty page]] |
| 47 |
!! endarticle |
| 48 |
|
| 49 |
!! article |
| 50 |
File:Redirect to foobar.jpg |
| 51 |
!! text |
| 52 |
#REDIRECT[[File:Foobar.jpg]] |
| 53 |
!! endarticle |
| 54 |
|
| 55 |
### |
| 56 |
### Images |
| 57 |
### |
| 58 |
### For Parsoid-specific tests, see |
| 59 |
### https://www.mediawiki.org/wiki/Specs/HTML#Images |
| 60 |
|
| 61 |
!! test |
| 62 |
Simple image |
| 63 |
!! options |
| 64 |
parsoid=wt2html,wt2wt,html2html |
| 65 |
!! config |
| 66 |
wgParserEnableLegacyMediaDOM=true |
| 67 |
!! wikitext |
| 68 |
[[Image:foobar.jpg]] |
| 69 |
!! html/php |
| 70 |
<p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 71 |
</p> |
| 72 |
!! html/parsoid |
| 73 |
<p><span class="mw-default-size" typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a></span></p> |
| 74 |
!! end |
| 75 |
|
| 76 |
!! test |
| 77 |
Simple image redirect |
| 78 |
!! options |
| 79 |
parsoid=wt2html,wt2wt,html2html |
| 80 |
!! config |
| 81 |
wgParserEnableLegacyMediaDOM=true |
| 82 |
!! wikitext |
| 83 |
[[Image:Redirect to foobar.jpg]] |
| 84 |
!! html/php |
| 85 |
<p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 86 |
</p> |
| 87 |
!! html/parsoid+integrated |
| 88 |
<p><span class="mw-default-size" typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a></span></p> |
| 89 |
!! end |
| 90 |
|
| 91 |
!! test |
| 92 |
Serialize simple image with figure-inline wrapper |
| 93 |
!! options |
| 94 |
parsoid=html2wt |
| 95 |
!! html/parsoid |
| 96 |
<p><figure-inline class="mw-default-size" typeof="mw:File"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a></figure-inline></p> |
| 97 |
!! wikitext |
| 98 |
[[File:Foobar.jpg]] |
| 99 |
!! end |
| 100 |
|
| 101 |
!! test |
| 102 |
Simple image (using File: namespace, now canonical) |
| 103 |
!! config |
| 104 |
wgParserEnableLegacyMediaDOM=true |
| 105 |
!! wikitext |
| 106 |
[[File:Foobar.jpg]] |
| 107 |
!! html/php |
| 108 |
<p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 109 |
</p> |
| 110 |
!! html/parsoid |
| 111 |
<p><span class="mw-default-size" typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a></span></p> |
| 112 |
!! end |
| 113 |
|
| 114 |
!! test |
| 115 |
Right-aligned image |
| 116 |
!! config |
| 117 |
wgParserEnableLegacyMediaDOM=true |
| 118 |
!! wikitext |
| 119 |
[[File:Foobar.jpg|right]] |
| 120 |
!! html/php |
| 121 |
<div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a></div> |
| 122 |
!! html/parsoid |
| 123 |
<figure class="mw-default-size mw-halign-right" typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a><figcaption></figcaption></figure> |
| 124 |
!! end |
| 125 |
|
| 126 |
!! test |
| 127 |
Image with caption |
| 128 |
!! config |
| 129 |
wgParserEnableLegacyMediaDOM=true |
| 130 |
!! wikitext |
| 131 |
[[File:Foobar.jpg|right|Caption text]] |
| 132 |
!! html/php |
| 133 |
<div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption text"><img alt="Caption text" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a></div> |
| 134 |
!! html/parsoid |
| 135 |
<figure class="mw-default-size mw-halign-right" typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description" title="Caption text"><img alt="Caption text" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a><figcaption>Caption text</figcaption></figure> |
| 136 |
!! end |
| 137 |
|
| 138 |
!! test |
| 139 |
Image with caption, T55312 #1 |
| 140 |
!! config |
| 141 |
wgParserEnableLegacyMediaDOM=true |
| 142 |
!! wikitext |
| 143 |
[[File:Foobar.jpg|right|Caption page stuff]] |
| 144 |
!! html/php |
| 145 |
<div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption page stuff"><img alt="Caption page stuff" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a></div> |
| 146 |
!! html/parsoid |
| 147 |
<figure class="mw-default-size mw-halign-right" typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description" title="Caption page stuff"><img alt="Caption page stuff" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a><figcaption>Caption page stuff</figcaption></figure> |
| 148 |
!! end |
| 149 |
|
| 150 |
!! test |
| 151 |
Image with caption, T55312 #2 |
| 152 |
!! config |
| 153 |
wgParserEnableLegacyMediaDOM=true |
| 154 |
!! wikitext |
| 155 |
[[File:Foobar.jpg|right|Caption page=]] |
| 156 |
!! html/php |
| 157 |
<div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption page="><img alt="Caption page=" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a></div> |
| 158 |
!! html/parsoid |
| 159 |
<figure class="mw-default-size mw-halign-right" typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description" title="Caption page="><img alt="Caption page=" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a><figcaption>Caption page=</figcaption></figure> |
| 160 |
!! end |
| 161 |
|
| 162 |
!! test |
| 163 |
Image with caption, T55312 #3 |
| 164 |
!! config |
| 165 |
wgParserEnableLegacyMediaDOM=true |
| 166 |
!! wikitext |
| 167 |
[[File:Foobar.jpg|right|Caption page=stuff]] |
| 168 |
!! html/php |
| 169 |
<div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption page=stuff"><img alt="Caption page=stuff" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a></div> |
| 170 |
!! html/parsoid |
| 171 |
<figure class="mw-default-size mw-halign-right" typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description" title="Caption page=stuff"><img alt="Caption page=stuff" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a><figcaption>Caption page=stuff</figcaption></figure> |
| 172 |
!! end |
| 173 |
|
| 174 |
!! test |
| 175 |
Image caption with pipe entity |
| 176 |
!! config |
| 177 |
wgParserEnableLegacyMediaDOM=true |
| 178 |
!! wikitext |
| 179 |
[[File:Foobar.jpg|thumb|one | two]] |
| 180 |
[[File:Foobar.jpg|thumb|one ''two'' | three]] |
| 181 |
!! html/php |
| 182 |
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>one | two</div></div></div> |
| 183 |
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>one <i>two</i> | three</div></div></div> |
| 184 |
!! html/parsoid |
| 185 |
<figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a><figcaption>one <span typeof="mw:Entity">|</span> two</figcaption></figure> |
| 186 |
<figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a><figcaption>one <i>two</i> <span typeof="mw:Entity">|</span> three</figcaption></figure> |
| 187 |
!! end |
| 188 |
|
| 189 |
!! test |
| 190 |
Bad images - basic functionality |
| 191 |
!! config |
| 192 |
wgParserEnableLegacyMediaDOM=true |
| 193 |
!! wikitext |
| 194 |
[[File:Bad.jpg]] |
| 195 |
!! html/php |
| 196 |
<p><a href="/wiki/File:Bad.jpg" title="File:Bad.jpg">File:Bad.jpg</a> |
| 197 |
</p> |
| 198 |
!! html/parsoid |
| 199 |
<p><span class="mw-default-size" typeof="mw:Error mw:File" data-mw='{"errors":[{"key":"apierror-badfile","message":"This image is on the bad file list."}]}'><a href="./Special:FilePath/Bad.jpg"><span class="mw-file-element mw-broken-media" resource="./File:Bad.jpg">File:Bad.jpg</span></a></span></p> |
| 200 |
!! end |
| 201 |
|
| 202 |
!! test |
| 203 |
Bad images - T18039: text after bad image disappears |
| 204 |
!! config |
| 205 |
wgParserEnableLegacyMediaDOM=true |
| 206 |
!! wikitext |
| 207 |
Foo bar |
| 208 |
[[File:Bad.jpg]] |
| 209 |
Bar foo |
| 210 |
!! html/php |
| 211 |
<p>Foo bar |
| 212 |
<a href="/wiki/File:Bad.jpg" title="File:Bad.jpg">File:Bad.jpg</a> |
| 213 |
Bar foo |
| 214 |
</p> |
| 215 |
!! html/parsoid |
| 216 |
<p>Foo bar |
| 217 |
<span class="mw-default-size" typeof="mw:Error mw:File" data-mw='{"errors":[{"key":"apierror-badfile","message":"This image is on the bad file list."}]}'><a href="./Special:FilePath/Bad.jpg"><span class="mw-file-element mw-broken-media" resource="./File:Bad.jpg">File:Bad.jpg</span></a></span> |
| 218 |
Bar foo</p> |
| 219 |
!! end |
| 220 |
|
| 221 |
!! test |
| 222 |
Bad images - manualthumb |
| 223 |
!! config |
| 224 |
wgParserEnableLegacyMediaDOM=true |
| 225 |
!! wikitext |
| 226 |
[[File:Foobar.jpg|thumbnail=Bad.jpg|Uh oh]] |
| 227 |
!! html/php |
| 228 |
<div class="thumb tright"><div class="thumbinner" style="width:322px;"><a href="/wiki/File:Foobar.jpg" title="File:Foobar.jpg">File:Foobar.jpg</a> <div class="thumbcaption">Uh oh</div></div></div> |
| 229 |
!! html/parsoid |
| 230 |
<figure typeof="mw:Error mw:File/Thumb" data-mw='{"attribs":[["manualthumb",{"txt":"Bad.jpg"}]],"errors":[{"key":"apierror-badfile","message":"This image is on the bad file list."}]}'><a href="./Special:FilePath/Foobar.jpg"><span class="mw-file-element mw-broken-media" resource="./File:Foobar.jpg">File:Foobar.jpg</span></a><figcaption>Uh oh</figcaption></figure> |
| 231 |
!! end |
| 232 |
|
| 233 |
!! test |
| 234 |
Bad images - in gallery |
| 235 |
!! config |
| 236 |
wgParserEnableLegacyMediaDOM=true |
| 237 |
!! wikitext |
| 238 |
<gallery> |
| 239 |
File:Bad.jpg |
| 240 |
</gallery> |
| 241 |
!! html/php |
| 242 |
<ul class="gallery mw-gallery-traditional"> |
| 243 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 244 |
<div class="thumb" style="height: 150px;"><a href="/wiki/File:Bad.jpg" title="File:Bad.jpg">Bad.jpg</a></div> |
| 245 |
<div class="gallerytext"></div> |
| 246 |
</div></li> |
| 247 |
</ul> |
| 248 |
!! html/parsoid |
| 249 |
<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt3" data-mw='{"name":"gallery","attrs":{},"body":{}}'> |
| 250 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="height: 150px;"><span typeof="mw:Error mw:File" data-mw='{"errors":[{"key":"apierror-badfile","message":"This image is on the bad file list."}]}'><a href="./Special:FilePath/Bad.jpg"><span class="mw-file-element mw-broken-media" resource="./File:Bad.jpg" data-width="120" data-height="120">File:Bad.jpg</span></a></span></div><div class="gallerytext"></div></li> |
| 251 |
</ul> |
| 252 |
!! end |
| 253 |
|
| 254 |
!! article |
| 255 |
Link1 |
| 256 |
!! text |
| 257 |
Dummy article to suppress redlinks in tests |
| 258 |
!! end |
| 259 |
|
| 260 |
!! article |
| 261 |
Link2 |
| 262 |
!! text |
| 263 |
Dummy article to suppress redlinks in tests |
| 264 |
!! end |
| 265 |
|
| 266 |
!! test |
| 267 |
Allow empty links in image captions (T62753) |
| 268 |
!! options |
| 269 |
thumbsize=220 |
| 270 |
!! config |
| 271 |
wgParserEnableLegacyMediaDOM=true |
| 272 |
!! wikitext |
| 273 |
[[File:Foobar.jpg|thumb|Caption [[Link1]] |
| 274 |
[[]] |
| 275 |
[[Link2]] |
| 276 |
]] |
| 277 |
!! html/php |
| 278 |
<div class="thumb tright"><div class="thumbinner" style="width:222px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" decoding="async" width="220" height="25" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>Caption <a href="/wiki/Link1" title="Link1">Link1</a> [[]] <a href="/wiki/Link2" title="Link2">Link2</a> </div></div></div> |
| 279 |
!! html/parsoid |
| 280 |
<figure class="mw-default-size" typeof="mw:File/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"caption","ak":"Caption [[Link1]]\n[[]]\n[[Link2]]\n"}]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" decoding="async" 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" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"25","width":"220"},"sa":{"resource":"File:Foobar.jpg"}}' class="mw-file-element"/></a><figcaption>Caption <a rel="mw:WikiLink" href="./Link1" title="Link1" data-parsoid='{"stx":"simple","a":{"href":"./Link1"},"sa":{"href":"Link1"}}'>Link1</a> |
| 281 |
[[]] |
| 282 |
<a rel="mw:WikiLink" href="./Link2" title="Link2" data-parsoid='{"stx":"simple","a":{"href":"./Link2"},"sa":{"href":"Link2"}}'>Link2</a> |
| 283 |
</figcaption></figure> |
| 284 |
!! end |
| 285 |
|
| 286 |
!! test |
| 287 |
Titles in unlinked images (T23454) |
| 288 |
!! config |
| 289 |
wgParserEnableLegacyMediaDOM=true |
| 290 |
!! wikitext |
| 291 |
[[File:Foobar.jpg|link=|stuff]] |
| 292 |
!! html/php |
| 293 |
<p><img alt="stuff" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" title="stuff" width="1941" height="220" /> |
| 294 |
</p> |
| 295 |
!! html/parsoid |
| 296 |
<p><span class="mw-default-size" typeof="mw:File" data-mw='{"caption":"stuff"}'><span title="stuff"><img alt="stuff" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></span></span></p> |
| 297 |
!! end |
| 298 |
|
| 299 |
!! test |
| 300 |
Link with empty target |
| 301 |
!! wikitext |
| 302 |
[[]] |
| 303 |
!! html |
| 304 |
<p>[[]] |
| 305 |
</p> |
| 306 |
!! end |
| 307 |
|
| 308 |
!! test |
| 309 |
Image with link trail |
| 310 |
!! config |
| 311 |
wgParserEnableLegacyMediaDOM=true |
| 312 |
!! wikitext |
| 313 |
Linktrails should not work for images: [[File:Foobar.jpg]]s |
| 314 |
!! html/php |
| 315 |
<p>Linktrails should not work for images: <a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a>s |
| 316 |
</p> |
| 317 |
!! html/parsoid |
| 318 |
<p>Linktrails should not work for images: <span class="mw-default-size" typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a></span>s</p> |
| 319 |
!! end |
| 320 |
|
| 321 |
!! test |
| 322 |
Image with empty attribute |
| 323 |
!! options |
| 324 |
parsoid=wt2html,wt2wt,html2html |
| 325 |
!! config |
| 326 |
wgParserEnableLegacyMediaDOM=true |
| 327 |
!! wikitext |
| 328 |
[[File:Foobar.jpg|right||Caption text]] |
| 329 |
!! html/php |
| 330 |
<div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption text"><img alt="Caption text" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a></div> |
| 331 |
!! html/parsoid |
| 332 |
<figure class="mw-default-size mw-halign-right" typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description" title="Caption text"><img alt="Caption text" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a><figcaption>Caption text</figcaption></figure> |
| 333 |
!! end |
| 334 |
|
| 335 |
!! test |
| 336 |
1. Block image with individual attributes from templates |
| 337 |
!! config |
| 338 |
wgParserEnableLegacyMediaDOM=true |
| 339 |
!! wikitext |
| 340 |
[[File:Foobar.jpg|thumb|{{1x|137px}}|This is a caption]] |
| 341 |
!! html/php |
| 342 |
<div class="thumb tright"><div class="thumbinner" style="width:139px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/137px-Foobar.jpg" decoding="async" width="137" height="16" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/206px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/274px-Foobar.jpg 2x" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>This is a caption</div></div></div> |
| 343 |
!! html/parsoid |
| 344 |
<figure typeof="mw:File/Thumb mw:ExpandedAttrs" about="#mwt2" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"width","ak":"{{1x|137px}}"},{"ck":"caption","ak":"This is a caption"}]}' data-mw='{"attribs":[["width",{"html":"<span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"1x\",\"href\":\"./Template:1x\"},\"params\":{\"1\":{\"wt\":\"137px\"}},\"i\":0}}]}'>137px</span>"}]]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/137px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="16" width="137" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/206px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/274px-Foobar.jpg 2x" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"16","width":"137"},"sa":{"resource":"File:Foobar.jpg"}}' class="mw-file-element"/></a><figcaption>This is a caption</figcaption></figure> |
| 345 |
!! end |
| 346 |
|
| 347 |
!! test |
| 348 |
2. Block Image with individual attributes from templates |
| 349 |
!! config |
| 350 |
wgParserEnableLegacyMediaDOM=true |
| 351 |
!! wikitext |
| 352 |
[[File:Foobar.jpg|{{1x|thumb}}|{{1x|137px}}|This is a caption]] |
| 353 |
!! html/php |
| 354 |
<div class="thumb tright"><div class="thumbinner" style="width:139px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/137px-Foobar.jpg" decoding="async" width="137" height="16" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/206px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/274px-Foobar.jpg 2x" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>This is a caption</div></div></div> |
| 355 |
!! html/parsoid |
| 356 |
<figure typeof="mw:File/Thumb mw:ExpandedAttrs" about="#mwt3" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"{{1x|thumb}}"},{"ck":"width","ak":"{{1x|137px}}"},{"ck":"caption","ak":"This is a caption"}]}' data-mw='{"attribs":[["thumbnail",{"html":"<span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"1x\",\"href\":\"./Template:1x\"},\"params\":{\"1\":{\"wt\":\"thumb\"}},\"i\":0}}]}'>thumb</span>"}],["width",{"html":"<span about=\"#mwt2\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"1x\",\"href\":\"./Template:1x\"},\"params\":{\"1\":{\"wt\":\"137px\"}},\"i\":0}}]}'>137px</span>"}]]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/137px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="16" width="137" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/206px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/274px-Foobar.jpg 2x" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"16","width":"137"},"sa":{"resource":"File:Foobar.jpg"}}' class="mw-file-element"/></a><figcaption>This is a caption</figcaption></figure> |
| 357 |
!! end |
| 358 |
|
| 359 |
!! test |
| 360 |
3. Inline image with individual attributes from templates |
| 361 |
!! config |
| 362 |
wgParserEnableLegacyMediaDOM=true |
| 363 |
!! wikitext |
| 364 |
[[File:Foobar.jpg|{{1x|50px}}]] |
| 365 |
!! html/php |
| 366 |
<p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg" decoding="async" width="50" height="6" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/75px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/100px-Foobar.jpg 2x" /></a> |
| 367 |
</p> |
| 368 |
!! html/parsoid |
| 369 |
<p><span typeof="mw:File mw:ExpandedAttrs" about="#mwt2" data-parsoid='{"optList":[{"ck":"width","ak":"{{1x|50px}}"}]}' data-mw='{"attribs":[["width",{"html":"<span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"1x\",\"href\":\"./Template:1x\"},\"params\":{\"1\":{\"wt\":\"50px\"}},\"i\":0}}]}'>50px</span>"}]]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="6" width="50" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/75px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/100px-Foobar.jpg 2x" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"6","width":"50"},"sa":{"resource":"File:Foobar.jpg"}}' class="mw-file-element"/></a></span></p> |
| 370 |
!! end |
| 371 |
|
| 372 |
## Parsoid does not provide editing support for images where templates produce multiple image attributes. |
| 373 |
## To signal this, we add a 'mw:Placeholder' type to such images. This could change in the future. |
| 374 |
!! test |
| 375 |
Image with multiple attributes from the same template |
| 376 |
!! config |
| 377 |
wgParserEnableLegacyMediaDOM=true |
| 378 |
!! wikitext |
| 379 |
[[File:Foobar.jpg|{{image_attribs}}]] |
| 380 |
!! html/php |
| 381 |
<div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption text"><img alt="Caption text" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a></div> |
| 382 |
!! html/parsoid |
| 383 |
<figure class="mw-default-size mw-halign-right" typeof="mw:File mw:Placeholder"><a href="./File:Foobar.jpg" class="mw-file-description" title="Caption text"><img alt="Caption text" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a><figcaption>Caption text</figcaption></figure> |
| 384 |
!! end |
| 385 |
|
| 386 |
!! test |
| 387 |
Image with link tails |
| 388 |
!! options |
| 389 |
thumbsize=220 |
| 390 |
!! config |
| 391 |
wgParserEnableLegacyMediaDOM=true |
| 392 |
!! wikitext |
| 393 |
123[[File:Foobar.jpg]]456 |
| 394 |
123[[File:Foobar.jpg|right]]456 |
| 395 |
123[[File:Foobar.jpg|thumb]]456 |
| 396 |
!! html/php |
| 397 |
<p>123<a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a>456 |
| 398 |
</p><p> |
| 399 |
123</p><div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a></div><p>456 |
| 400 |
123</p><div class="thumb tright"><div class="thumbinner" style="width:222px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" decoding="async" width="220" height="25" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div></div></div></div><p>456</p> |
| 401 |
!! html/parsoid |
| 402 |
<p>123<span class="mw-default-size" typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a></span>456</p> |
| 403 |
<p>123</p><figure class="mw-default-size mw-halign-right" typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a><figcaption></figcaption></figure><p>456 |
| 404 |
123</p><figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" decoding="async" 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" class="mw-file-element"/></a><figcaption></figcaption></figure> |
| 405 |
<p>456</p> |
| 406 |
!! end |
| 407 |
|
| 408 |
!! test |
| 409 |
Image with multiple captions -- only last one is accepted |
| 410 |
!! config |
| 411 |
wgParserEnableLegacyMediaDOM=true |
| 412 |
!! wikitext |
| 413 |
[[File:Foobar.jpg|right|Caption1 - ignored|[[Caption2]] - ignored|Caption3 - accepted]] |
| 414 |
!! html/php |
| 415 |
<div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption3 - accepted"><img alt="Caption3 - accepted" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a></div> |
| 416 |
!! html/parsoid |
| 417 |
<figure class="mw-default-size mw-halign-right" typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description" title="Caption3 - accepted"><img alt="Caption3 - accepted" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a><figcaption>Caption3 - accepted</figcaption></figure> |
| 418 |
!! end |
| 419 |
|
| 420 |
!! test |
| 421 |
Image with multiple widths -- use last |
| 422 |
!! config |
| 423 |
wgParserEnableLegacyMediaDOM=true |
| 424 |
!! wikitext |
| 425 |
[[File:Foobar.jpg|200px|300px|caption]] |
| 426 |
!! html/php |
| 427 |
<p><a href="/wiki/File:Foobar.jpg" class="image" title="caption"><img alt="caption" src="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg" decoding="async" width="300" height="34" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/450px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/600px-Foobar.jpg 2x" /></a> |
| 428 |
</p> |
| 429 |
!! html/parsoid |
| 430 |
<p><span typeof="mw:File" data-mw='{"caption":"caption"}'><a href="./File:Foobar.jpg" class="mw-file-description" title="caption"><img alt="caption" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="34" width="300" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/450px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/600px-Foobar.jpg 2x" class="mw-file-element"/></a></span></p> |
| 431 |
!! end |
| 432 |
|
| 433 |
!! test |
| 434 |
Image with multiple alignments -- use first (T50664) |
| 435 |
!! options |
| 436 |
thumbsize=220 |
| 437 |
!! config |
| 438 |
wgParserEnableLegacyMediaDOM=true |
| 439 |
!! wikitext |
| 440 |
[[File:Foobar.jpg|thumb|left|right|center|caption]] |
| 441 |
|
| 442 |
[[File:Foobar.jpg|middle|text-top|caption]] |
| 443 |
!! html/php |
| 444 |
<div class="thumb tleft"><div class="thumbinner" style="width:222px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" decoding="async" width="220" height="25" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>caption</div></div></div> |
| 445 |
<p><a href="/wiki/File:Foobar.jpg" class="image" title="caption"><img alt="caption" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" style="vertical-align: middle" /></a> |
| 446 |
</p> |
| 447 |
!! html/parsoid |
| 448 |
<figure class="mw-default-size mw-halign-left" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" decoding="async" 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" class="mw-file-element"/></a><figcaption>caption</figcaption></figure> |
| 449 |
<p><span class="mw-default-size mw-valign-middle" typeof="mw:File" data-mw='{"caption":"caption"}'><a href="./File:Foobar.jpg" class="mw-file-description" title="caption"><img alt="caption" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a></span></p> |
| 450 |
!! end |
| 451 |
|
| 452 |
!! test |
| 453 |
Image with width attribute at different positions |
| 454 |
!! config |
| 455 |
wgParserEnableLegacyMediaDOM=true |
| 456 |
!! wikitext |
| 457 |
[[File:Foobar.jpg|200px|right|Caption]] |
| 458 |
[[File:Foobar.jpg|right|200px|Caption]] |
| 459 |
[[File:Foobar.jpg|right|Caption|200px]] |
| 460 |
!! html/php |
| 461 |
<div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption"><img alt="Caption" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" decoding="async" width="200" height="23" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/400px-Foobar.jpg 2x" /></a></div> |
| 462 |
<div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption"><img alt="Caption" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" decoding="async" width="200" height="23" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/400px-Foobar.jpg 2x" /></a></div> |
| 463 |
<div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption"><img alt="Caption" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" decoding="async" width="200" height="23" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/400px-Foobar.jpg 2x" /></a></div> |
| 464 |
!! html/parsoid |
| 465 |
<figure class="mw-halign-right" typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description" title="Caption"><img alt="Caption" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="23" width="200" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/400px-Foobar.jpg 2x" class="mw-file-element"/></a><figcaption>Caption</figcaption></figure> |
| 466 |
<figure class="mw-halign-right" typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description" title="Caption"><img alt="Caption" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="23" width="200" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/400px-Foobar.jpg 2x" class="mw-file-element"/></a><figcaption>Caption</figcaption></figure> |
| 467 |
<figure class="mw-halign-right" typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description" title="Caption"><img alt="Caption" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="23" width="200" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/400px-Foobar.jpg 2x" class="mw-file-element"/></a><figcaption>Caption</figcaption></figure> |
| 468 |
!! end |
| 469 |
|
| 470 |
# a sad bit of backward-compatibility |
| 471 |
!! test |
| 472 |
Image with size specified with pxpx (T15500, T53628) |
| 473 |
!! options |
| 474 |
parsoid=wt2html,wt2wt,html2html |
| 475 |
cat |
| 476 |
!! config |
| 477 |
wgParserEnableLegacyMediaDOM=true |
| 478 |
!! metadata |
| 479 |
cat=Pages_with_image_sizes_containing_extra_px sort= |
| 480 |
!! wikitext |
| 481 |
[[File:Foobar.jpg|20pxpx]] |
| 482 |
[[File:Foobar.jpg|200x20pxpx]] |
| 483 |
!! html/php |
| 484 |
<p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/20px-Foobar.jpg" decoding="async" width="20" height="2" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/30px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/40px-Foobar.jpg 2x" /></a> |
| 485 |
<a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/177px-Foobar.jpg" decoding="async" width="177" height="20" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/265px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/353px-Foobar.jpg 2x" /></a> |
| 486 |
</p> |
| 487 |
!! html/parsoid |
| 488 |
<p><span typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/20px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="2" width="20" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/30px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/40px-Foobar.jpg 2x" class="mw-file-element"/></a></span> <span typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/177px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="177" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/265px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/353px-Foobar.jpg 2x" class="mw-file-element"/></a></span></p> |
| 489 |
!! end |
| 490 |
|
| 491 |
!! test |
| 492 |
T374311: Gallery with trailing px should not trigger double-px |
| 493 |
!! config |
| 494 |
wgParserEnableLegacyMediaDOM=true |
| 495 |
!! options |
| 496 |
parsoid=wt2html |
| 497 |
cat |
| 498 |
!! wikitext |
| 499 |
<gallery widths="100px"> |
| 500 |
File:Foobar.jpg |
| 501 |
</gallery> |
| 502 |
!! metadata |
| 503 |
!! html/php |
| 504 |
<ul class="gallery mw-gallery-traditional"> |
| 505 |
<li class="gallerybox" style="width: 135px"><div style="width: 135px"> |
| 506 |
<div class="thumb" style="width: 130px;"><div style="margin:69.5px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/100px-Foobar.jpg" decoding="async" width="100" height="11" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/150px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg 2x" /></a></div></div> |
| 507 |
<div class="gallerytext"></div> |
| 508 |
</div></li> |
| 509 |
</ul> |
| 510 |
!! html/parsoid |
| 511 |
<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" data-mw='{"name":"gallery","attrs":{"widths":"100px"},"body":{}}'> |
| 512 |
<li class="gallerybox" style="width: 135px;"> |
| 513 |
<div class="thumb" style="width: 130px; height: 150px;"><span typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/100px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="11" width="100" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/150px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div> |
| 514 |
<div class="gallerytext"></div> |
| 515 |
</li> |
| 516 |
</ul> |
| 517 |
!! end |
| 518 |
|
| 519 |
!! test |
| 520 |
Image with link parameter, wiki target |
| 521 |
!! config |
| 522 |
wgParserEnableLegacyMediaDOM=true |
| 523 |
!! wikitext |
| 524 |
[[File:Foobar.jpg|link=Main Page]] |
| 525 |
!! html/php |
| 526 |
<p><a href="/wiki/Main_Page" title="Main Page"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 527 |
</p> |
| 528 |
!! html/parsoid |
| 529 |
<p><span class="mw-default-size" typeof="mw:File"><a href="./Main_Page" title="Main Page"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a></span></p> |
| 530 |
!! end |
| 531 |
|
| 532 |
# parsoid T51293 (part 1) |
| 533 |
!! test |
| 534 |
Image with link parameter, URL target |
| 535 |
!! config |
| 536 |
wgParserEnableLegacyMediaDOM=true |
| 537 |
!! wikitext |
| 538 |
[[File:Foobar.jpg|link=http://example.com/]] |
| 539 |
!! html/php |
| 540 |
<p><a href="http://example.com/" rel="nofollow"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 541 |
</p> |
| 542 |
!! html/parsoid |
| 543 |
<p><span class="mw-default-size" typeof="mw:File"><a href="http://example.com/"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a></span></p> |
| 544 |
!! end |
| 545 |
|
| 546 |
# parsoid T51293 (part 2) |
| 547 |
!! test |
| 548 |
Image with link parameter, protocol-less URL target |
| 549 |
!! config |
| 550 |
wgParserEnableLegacyMediaDOM=true |
| 551 |
!! wikitext |
| 552 |
[[File:Foobar.jpg|link=//example.com/]] |
| 553 |
!! html/php |
| 554 |
<p><a href="//example.com/" rel="nofollow"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 555 |
</p> |
| 556 |
!! html/parsoid |
| 557 |
<p><span class="mw-default-size" typeof="mw:File"><a href="//example.com/"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a></span></p> |
| 558 |
!! end |
| 559 |
|
| 560 |
!! test |
| 561 |
Escaping non-block captions (T107435) |
| 562 |
!! options |
| 563 |
parsoid={ |
| 564 |
"modes": ["wt2wt"], |
| 565 |
"changes": [ |
| 566 |
["[typeof~='mw:File']", "attr", "data-mw", "{\"caption\": \"|\"}"] |
| 567 |
] |
| 568 |
} |
| 569 |
!! wikitext |
| 570 |
[[Image:Foobar.jpg|alt=123|caption]] |
| 571 |
!! wikitext/edited |
| 572 |
[[Image:Foobar.jpg|alt=123|<nowiki>|</nowiki>]] |
| 573 |
!! end |
| 574 |
|
| 575 |
!! test |
| 576 |
Image with link parameter, wgExternalLinkTarget |
| 577 |
!! wikitext |
| 578 |
[[File:Foobar.jpg|link=http://example.com/]] |
| 579 |
!! config |
| 580 |
wgExternalLinkTarget="foobar" |
| 581 |
wgParserEnableLegacyMediaDOM=true |
| 582 |
!! html/php |
| 583 |
<p><a href="http://example.com/" target="foobar" rel="nofollow noreferrer noopener"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 584 |
</p> |
| 585 |
!! html/parsoid |
| 586 |
<p><span class="mw-default-size" typeof="mw:File"><a href="http://example.com/" rel="nofollow noreferrer noopener" target="foobar"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a></span></p> |
| 587 |
!! end |
| 588 |
|
| 589 |
!! test |
| 590 |
Image with link parameter, wgNoFollowLinks set to false |
| 591 |
!! wikitext |
| 592 |
[[File:Foobar.jpg|link=http://example.com/]] |
| 593 |
!! config |
| 594 |
wgNoFollowLinks=false |
| 595 |
wgParserEnableLegacyMediaDOM=true |
| 596 |
!! html/php |
| 597 |
<p><a href="http://example.com/"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 598 |
</p> |
| 599 |
!! html/parsoid |
| 600 |
<p><span class="mw-default-size" typeof="mw:File"><a href="http://example.com/"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a></span></p> |
| 601 |
!! end |
| 602 |
|
| 603 |
!! test |
| 604 |
Image with link parameter, wgNoFollowDomainExceptions |
| 605 |
!! wikitext |
| 606 |
[[File:Foobar.jpg|link=http://example.com/]] |
| 607 |
!! config |
| 608 |
wgNoFollowDomainExceptions=["example.com"] |
| 609 |
wgParserEnableLegacyMediaDOM=true |
| 610 |
!! html/php |
| 611 |
<p><a href="http://example.com/"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 612 |
</p> |
| 613 |
!! html/parsoid |
| 614 |
<p><span class="mw-default-size" typeof="mw:File"><a href="http://example.com/"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a></span></p> |
| 615 |
!! end |
| 616 |
|
| 617 |
!! test |
| 618 |
Image with link parameter, wgExternalLinkTarget, unnamed parameter |
| 619 |
!! wikitext |
| 620 |
[[File:Foobar.jpg|link=http://example.com/|Title]] |
| 621 |
!! config |
| 622 |
wgExternalLinkTarget="foobar" |
| 623 |
wgParserEnableLegacyMediaDOM=true |
| 624 |
!! html/php |
| 625 |
<p><a href="http://example.com/" title="Title" target="foobar" rel="nofollow noreferrer noopener"><img alt="Title" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 626 |
</p> |
| 627 |
!! html/parsoid |
| 628 |
<p><span class="mw-default-size" typeof="mw:File" data-mw='{"caption":"Title"}'><a href="http://example.com/" rel="nofollow noreferrer noopener" target="foobar" title="Title"><img alt="Title" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a></span></p> |
| 629 |
!! end |
| 630 |
|
| 631 |
!! test |
| 632 |
Image with empty link parameter |
| 633 |
!! config |
| 634 |
wgParserEnableLegacyMediaDOM=true |
| 635 |
!! wikitext |
| 636 |
[[File:Foobar.jpg|link=]] |
| 637 |
!! html/php |
| 638 |
<p><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /> |
| 639 |
</p> |
| 640 |
!! html/parsoid |
| 641 |
<p><span class="mw-default-size" typeof="mw:File"><span><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></span></span></p> |
| 642 |
!! end |
| 643 |
|
| 644 |
!! test |
| 645 |
Image with link parameter (wiki target) and unnamed parameter |
| 646 |
!! config |
| 647 |
wgParserEnableLegacyMediaDOM=true |
| 648 |
!! wikitext |
| 649 |
[[File:Foobar.jpg|link=Main_Page|Title]] |
| 650 |
!! html/php |
| 651 |
<p><a href="/wiki/Main_Page" title="Title"><img alt="Title" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 652 |
</p> |
| 653 |
!! html/parsoid |
| 654 |
<p><span class="mw-default-size" typeof="mw:File" data-mw='{"caption":"Title"}'><a href="./Main_Page" title="Title"><img alt="Title" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a></span></p> |
| 655 |
!! end |
| 656 |
|
| 657 |
!! test |
| 658 |
Image with link parameter (URL target) and unnamed parameter |
| 659 |
!! config |
| 660 |
wgParserEnableLegacyMediaDOM=true |
| 661 |
!! wikitext |
| 662 |
[[File:Foobar.jpg|link=http://example.com/|Title]] |
| 663 |
!! html/php |
| 664 |
<p><a href="http://example.com/" title="Title" rel="nofollow"><img alt="Title" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 665 |
</p> |
| 666 |
!! html/parsoid |
| 667 |
<p><span class="mw-default-size" typeof="mw:File" data-mw='{"caption":"Title"}'><a href="http://example.com/" title="Title"><img alt="Title" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a></span></p> |
| 668 |
!! end |
| 669 |
|
| 670 |
!! test |
| 671 |
Thumbnail image with link parameter |
| 672 |
!! options |
| 673 |
thumbsize=220 |
| 674 |
parsoid=wt2html,wt2wt,html2html |
| 675 |
!! config |
| 676 |
wgParserEnableLegacyMediaDOM=true |
| 677 |
!! wikitext |
| 678 |
[[File:Foobar.jpg|thumb|link=http://example.com/|Title]] |
| 679 |
!! html/php |
| 680 |
<div class="thumb tright"><div class="thumbinner" style="width:222px;"><a href="http://example.com/" rel="nofollow"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" decoding="async" width="220" height="25" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>Title</div></div></div> |
| 681 |
!! html/parsoid |
| 682 |
<figure class="mw-default-size" typeof="mw:File/Thumb"><a href="http://example.com/"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" decoding="async" 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" class="mw-file-element"/></a><figcaption>Title</figcaption></figure> |
| 683 |
!! end |
| 684 |
|
| 685 |
!! test |
| 686 |
Manually-specified thumbnail image |
| 687 |
!! options |
| 688 |
thumbsize=220 |
| 689 |
!! config |
| 690 |
wgParserEnableLegacyMediaDOM=true |
| 691 |
!! wikitext |
| 692 |
[[File:Foobar.jpg|thumbnail=Thumb.png|Title]] |
| 693 |
!! html/php |
| 694 |
<div class="thumb tright"><div class="thumbinner" style="width:137px;"><a href="/wiki/File:Foobar.jpg" title="File:Foobar.jpg"><img src="http://example.com/images/e/ea/Thumb.png" decoding="async" width="135" height="135" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>Title</div></div></div> |
| 695 |
!! html/parsoid |
| 696 |
<figure typeof="mw:File/Thumb" about="#mwt1" data-mw='{"attribs":[["manualthumb",{"txt":"Thumb.png"}]]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/e/ea/Thumb.png" decoding="async" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135" class="mw-file-element"/></a><figcaption>Title</figcaption></figure> |
| 697 |
!! end |
| 698 |
|
| 699 |
!! test |
| 700 |
Manually-specified thumbnail image (backwards compat) |
| 701 |
!! options |
| 702 |
thumbsize=220 |
| 703 |
parsoid=html2wt |
| 704 |
!! config |
| 705 |
wgParserEnableLegacyMediaDOM=true |
| 706 |
!! wikitext |
| 707 |
[[File:Foobar.jpg|thumbnail=Thumb.png|Title]] |
| 708 |
!! html/php |
| 709 |
<div class="thumb tright"><div class="thumbinner" style="width:137px;"><a href="/wiki/File:Foobar.jpg" title="File:Foobar.jpg"><img src="http://example.com/images/e/ea/Thumb.png" decoding="async" width="135" height="135" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>Title</div></div></div> |
| 710 |
!! html/parsoid |
| 711 |
<figure class="mw-default-size" typeof="mw:File/Thumb" data-mw='{"thumb":"Thumb.png"}'><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="http://example.com/images/e/ea/Thumb.png" decoding="async" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135" class="mw-file-element"/></a><figcaption>Title</figcaption></figure> |
| 712 |
!! end |
| 713 |
|
| 714 |
!! test |
| 715 |
Manually-specified thumbnail image with explicit link to wiki page |
| 716 |
!! options |
| 717 |
thumbsize=220 |
| 718 |
parsoid=wt2html,wt2wt,html2html |
| 719 |
!! config |
| 720 |
wgParserEnableLegacyMediaDOM=true |
| 721 |
!! wikitext |
| 722 |
[[File:Foobar.jpg|thumb=Thumb.png|link=Main_Page|Title]] |
| 723 |
!! html/php |
| 724 |
<div class="thumb tright"><div class="thumbinner" style="width:137px;"><a href="/wiki/Main_Page" title="Main Page"><img src="http://example.com/images/e/ea/Thumb.png" decoding="async" width="135" height="135" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>Title</div></div></div> |
| 725 |
!! html/parsoid |
| 726 |
<figure typeof="mw:File/Thumb" data-mw='{"attribs":[["manualthumb",{"txt":"Thumb.png"}]]}'><a href="./Main_Page" title="Main Page"><img resource="./File:Foobar.jpg" src="http://example.com/images/e/ea/Thumb.png" decoding="async" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135" class="mw-file-element"/></a><figcaption>Title</figcaption></figure> |
| 727 |
!! end |
| 728 |
|
| 729 |
!! test |
| 730 |
Manually-specified thumbnail image with explicit link to url |
| 731 |
!! options |
| 732 |
thumbsize=220 |
| 733 |
parsoid=wt2html,wt2wt,html2html |
| 734 |
!! config |
| 735 |
wgParserEnableLegacyMediaDOM=true |
| 736 |
!! wikitext |
| 737 |
[[File:Foobar.jpg|thumb=Thumb.png|link=http://example.com|Title]] |
| 738 |
!! html/php |
| 739 |
<div class="thumb tright"><div class="thumbinner" style="width:137px;"><a href="http://example.com" rel="nofollow"><img src="http://example.com/images/e/ea/Thumb.png" decoding="async" width="135" height="135" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>Title</div></div></div> |
| 740 |
!! html/parsoid |
| 741 |
<figure typeof="mw:File/Thumb" data-mw='{"attribs":[["manualthumb",{"txt":"Thumb.png"}]]}'><a href="http://example.com"><img resource="./File:Foobar.jpg" src="http://example.com/images/e/ea/Thumb.png" decoding="async" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135" class="mw-file-element"/></a><figcaption>Title</figcaption></figure> |
| 742 |
!! end |
| 743 |
|
| 744 |
!! test |
| 745 |
Manually-specified thumbnail image with explicit no link |
| 746 |
!! options |
| 747 |
thumbsize=220 |
| 748 |
parsoid=wt2html,wt2wt,html2html |
| 749 |
!! config |
| 750 |
wgParserEnableLegacyMediaDOM=true |
| 751 |
!! wikitext |
| 752 |
[[File:Foobar.jpg|thumb=Thumb.png|link=|Title]] |
| 753 |
!! html/php |
| 754 |
<div class="thumb tright"><div class="thumbinner" style="width:137px;"><img src="http://example.com/images/e/ea/Thumb.png" decoding="async" width="135" height="135" class="thumbimage" /> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>Title</div></div></div> |
| 755 |
!! html/parsoid |
| 756 |
<figure typeof="mw:File/Thumb" data-mw='{"attribs":[["manualthumb",{"txt":"Thumb.png"}]]}'><span><img resource="./File:Foobar.jpg" src="http://example.com/images/e/ea/Thumb.png" decoding="async" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135" class="mw-file-element"/></span><figcaption>Title</figcaption></figure> |
| 757 |
!! end |
| 758 |
|
| 759 |
!! test |
| 760 |
Manually-specified thumbnail image with explicit link and alt text |
| 761 |
!! options |
| 762 |
thumbsize=220 |
| 763 |
parsoid=wt2html,wt2wt,html2html |
| 764 |
!! config |
| 765 |
wgParserEnableLegacyMediaDOM=true |
| 766 |
!! wikitext |
| 767 |
[[File:Foobar.jpg|thumb=Thumb.png|link=Main_Page|alt=alttext|Title]] |
| 768 |
!! html/php |
| 769 |
<div class="thumb tright"><div class="thumbinner" style="width:137px;"><a href="/wiki/Main_Page" title="Main Page"><img alt="alttext" src="http://example.com/images/e/ea/Thumb.png" decoding="async" width="135" height="135" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>Title</div></div></div> |
| 770 |
!! html/parsoid |
| 771 |
<figure typeof="mw:File/Thumb" data-mw='{"attribs":[["manualthumb",{"txt":"Thumb.png"}]]}'><a href="./Main_Page" title="Main Page"><img alt="alttext" resource="./File:Foobar.jpg" src="http://example.com/images/e/ea/Thumb.png" decoding="async" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135" class="mw-file-element"/></a><figcaption>Title</figcaption></figure> |
| 772 |
!! end |
| 773 |
|
| 774 |
!! test |
| 775 |
Image with frame and link |
| 776 |
!! options |
| 777 |
parsoid=wt2html,wt2wt,html2html |
| 778 |
!! config |
| 779 |
wgParserEnableLegacyMediaDOM=true |
| 780 |
!! wikitext |
| 781 |
[[File:Foobar.jpg|frame|left|This is a test image [[Main Page]]]] |
| 782 |
!! html/php |
| 783 |
<div class="thumb tleft"><div class="thumbinner" style="width:1943px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" class="thumbimage" /></a> <div class="thumbcaption">This is a test image <a href="/wiki/Main_Page" title="Main Page">Main Page</a></div></div></div> |
| 784 |
!! html/parsoid |
| 785 |
<figure class="mw-halign-left" typeof="mw:File/Frame"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a><figcaption>This is a test image <a rel="mw:WikiLink" href="./Main_Page" title="Main Page">Main Page</a></figcaption></figure> |
| 786 |
!! end |
| 787 |
|
| 788 |
!! test |
| 789 |
Image with frame and link and explicit alt |
| 790 |
!! options |
| 791 |
parsoid=wt2html,wt2wt,html2html |
| 792 |
!! config |
| 793 |
wgParserEnableLegacyMediaDOM=true |
| 794 |
!! wikitext |
| 795 |
[[Image:Foobar.jpg|frame|left|This is a test image [[Main Page]]|alt=Altitude]] |
| 796 |
!! html/php |
| 797 |
<div class="thumb tleft"><div class="thumbinner" style="width:1943px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Altitude" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" class="thumbimage" /></a> <div class="thumbcaption">This is a test image <a href="/wiki/Main_Page" title="Main Page">Main Page</a></div></div></div> |
| 798 |
!! html/parsoid |
| 799 |
<figure class="mw-halign-left" typeof="mw:File/Frame"><a href="./File:Foobar.jpg" class="mw-file-description"><img alt="Altitude" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a><figcaption>This is a test image <a rel="mw:WikiLink" href="./Main_Page" title="Main Page">Main Page</a></figcaption></figure> |
| 800 |
!! end |
| 801 |
|
| 802 |
!! test |
| 803 |
Image with wiki markup in implicit alt |
| 804 |
!! config |
| 805 |
wgParserEnableLegacyMediaDOM=true |
| 806 |
!! wikitext |
| 807 |
[[Image:Foobar.jpg|testing '''bold''' in alt]] |
| 808 |
|
| 809 |
[[Image:Foobar.jpg|alt=testing '''bold''' in alt]] |
| 810 |
!! html/php |
| 811 |
<p><a href="/wiki/File:Foobar.jpg" class="image" title="testing bold in alt"><img alt="testing bold in alt" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 812 |
</p><p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="testing bold in alt" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 813 |
</p> |
| 814 |
!! html/parsoid |
| 815 |
<p><span class="mw-default-size" typeof="mw:File" data-parsoid='{"optList":[{"ck":"caption","ak":"testing '''bold''' in alt"}]}' data-mw='{"caption":"testing <b data-parsoid='{\"dsr\":[27,37,3,3]}'>bold</b> in alt"}'><a href="./File:Foobar.jpg" class="mw-file-description" title="testing bold in alt"><img alt="testing bold in alt" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"220","width":"1941"},"sa":{"resource":"Image:Foobar.jpg"}}' class="mw-file-element"/></a></span></p> |
| 816 |
|
| 817 |
<p><span class="mw-default-size" typeof="mw:File mw:ExpandedAttrs" about="#mwt1" data-parsoid='{"optList":[{"ck":"alt","ak":"alt=testing '''bold''' in alt"}]}' data-mw='{"attribs":[["alt",{"html":"alt=testing <b data-parsoid='{\"dsr\":[79,89,3,3]}'>bold</b> in alt","txt":"testing bold in alt"}]]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img alt="testing bold in alt" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"220","width":"1941"},"sa":{"resource":"Image:Foobar.jpg"}}' class="mw-file-element"/></a></span></p> |
| 818 |
!! end |
| 819 |
|
| 820 |
!! test |
| 821 |
Alt image option should handle most kinds of wikitext without barfing |
| 822 |
!! config |
| 823 |
wgParserEnableLegacyMediaDOM=true |
| 824 |
!! wikitext |
| 825 |
[[Image:Foobar.jpg|thumb|This is the image caption|alt=This is a [[link]] and a {{1x|''bold template''}}.]] |
| 826 |
!! html/php |
| 827 |
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="This is a link and a bold template." src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>This is the image caption</div></div></div> |
| 828 |
!! html/parsoid |
| 829 |
<figure class="mw-default-size" typeof="mw:File/Thumb mw:ExpandedAttrs" about="#mwt2" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"caption","ak":"This is the image caption"},{"ck":"alt","ak":"alt=This is a [[link]] and a {{1x|''bold template''}}."}]}' data-mw='{"attribs":[["alt",{"html":"alt=This is a <a rel=\"mw:WikiLink\" href=\"./Link\" title=\"Link\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"./Link\"},\"sa\":{\"href\":\"link\"},\"dsr\":[65,73,2,2]}'>link</a> and a <i about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[80,104,null,null],\"pi\":[[{\"k\":\"1\"}]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"1x\",\"href\":\"./Template:1x\"},\"params\":{\"1\":{\"wt\":\"&apos;&apos;bold template&apos;&apos;\"}},\"i\":0}}]}'>bold template</i>.","txt":"This is a link and a bold template."}]]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img alt="This is a link and a bold template." resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"20","width":"180"},"sa":{"resource":"Image:Foobar.jpg"}}' class="mw-file-element"/></a><figcaption>This is the image caption</figcaption></figure> |
| 830 |
!! end |
| 831 |
|
| 832 |
!! test |
| 833 |
Ampersand in alt attribute (T206940) |
| 834 |
!! config |
| 835 |
wgParserEnableLegacyMediaDOM=true |
| 836 |
!! wikitext |
| 837 |
[[File:Foobar.jpg|alt=&amp;]] |
| 838 |
|
| 839 |
<!-- consistency with gallery extension --> |
| 840 |
<gallery> |
| 841 |
File:Foobar.jpg|alt=&amp; |
| 842 |
</gallery> |
| 843 |
!! html/php |
| 844 |
<p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="&amp;" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 845 |
</p> |
| 846 |
<ul class="gallery mw-gallery-traditional"> |
| 847 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 848 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="&amp;" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 849 |
<div class="gallerytext"></div> |
| 850 |
</div></li> |
| 851 |
</ul> |
| 852 |
!! html/parsoid |
| 853 |
<p><span class="mw-default-size" typeof="mw:File mw:ExpandedAttrs" about="#mwt1" data-mw='{"attribs":[["alt",{"html":"alt=<span typeof=\"mw:Entity\" data-parsoid='{\"src\":\"&amp;amp;\",\"srcContent\":\"&amp;\",\"dsr\":[22,27,null,null]}'>&amp;</span>amp;","txt":"&amp;"}]]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img alt="&amp;" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a></span></p> |
| 854 |
|
| 855 |
<!-- consistency with gallery extension --> |
| 856 |
<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt5" data-mw='{"name":"gallery","attrs":{},"body":{}}'> |
| 857 |
<li class="gallerybox" style="width: 155px;"> |
| 858 |
<div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File mw:ExpandedAttrs" data-mw='{"attribs":[["alt",{"html":"alt=<span typeof=\"mw:Entity\" data-parsoid='{\"src\":\"&amp;amp;\",\"srcContent\":\"&amp;\",\"dsr\":[109,114,null,null]}'>&amp;</span>amp;","txt":"&amp;"}]]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img alt="&amp;" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div> |
| 859 |
<div class="gallerytext"></div> |
| 860 |
</li> |
| 861 |
</ul> |
| 862 |
!! end |
| 863 |
|
| 864 |
## FIXME: The inconsistency in the gallery extension on the php side is T49646 |
| 865 |
# Parsoid test is only wt2html because it inserts <nowiki> around the |
| 866 |
# alt text when serializing (which is fine). |
| 867 |
!! test |
| 868 |
Link with encoded pipe in alt option |
| 869 |
!! options |
| 870 |
parsoid=wt2html |
| 871 |
!! config |
| 872 |
wgParserEnableLegacyMediaDOM=true |
| 873 |
!! wikitext |
| 874 |
[[File:Foobar.jpg|alt=http://testing.123?4=5|6|caption]] |
| 875 |
|
| 876 |
[[File:Foobar.jpg|alt=http://testing.123?4=5|6|caption]] |
| 877 |
|
| 878 |
<!-- consistency with gallery extension --> |
| 879 |
<gallery> |
| 880 |
File:Foobar.jpg|alt=http://testing.123?4=5|6|caption |
| 881 |
File:Foobar.jpg|alt=http://testing.123?4=5|6|caption |
| 882 |
</gallery> |
| 883 |
!! html/php |
| 884 |
<p><a href="/wiki/File:Foobar.jpg" class="image" title="caption"><img alt="http://testing.123?4=5|6" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 885 |
</p><p><a href="/wiki/File:Foobar.jpg" class="image" title="caption"><img alt="http://testing.123?4=5|6" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 886 |
</p> |
| 887 |
<ul class="gallery mw-gallery-traditional"> |
| 888 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 889 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="http://testing.123?4=5%7C6%7Ccaption" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 890 |
<div class="gallerytext"></div> |
| 891 |
</div></li> |
| 892 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 893 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="http://testing.123?4=5%7C6%7Ccaption" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 894 |
<div class="gallerytext"></div> |
| 895 |
</div></li> |
| 896 |
</ul> |
| 897 |
!! html/parsoid |
| 898 |
<p><span class="mw-default-size" typeof="mw:File mw:ExpandedAttrs" about="#mwt1" data-parsoid='{"optList":[{"ck":"alt","ak":"alt=http://testing.123?4=5&#x7C;6"},{"ck":"caption","ak":"caption"}]}' data-mw='{"attribs":[["alt",{"html":"alt=<a rel=\"mw:ExtLink\" href=\"http://testing.123?4=5%7C6\" class=\"external free\" data-parsoid='{\"stx\":\"url\",\"a\":{\"href\":\"http://testing.123?4=5%7C6\"},\"sa\":{\"href\":\"http://testing.123?4=5&amp;#x7C;6\"},\"dsr\":[22,51,0,0]}'>http://testing.123?4=5%7C6</a>","txt":"http://testing.123?4=5|6"}]],"caption":"caption"}'><a href="./File:Foobar.jpg" class="mw-file-description" title="caption"><img alt="http://testing.123?4=5|6" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a></span></p> |
| 899 |
|
| 900 |
<p><span class="mw-default-size" typeof="mw:File mw:ExpandedAttrs" about="#mwt1" data-parsoid='{"optList":[{"ck":"alt","ak":"alt=http://testing.123?4=5&vert;6"},{"ck":"caption","ak":"caption"}]}' data-mw='{"attribs":[["alt",{"html":"alt=<a rel=\"mw:ExtLink\" href=\"http://testing.123?4=5%7C6\" class=\"external free\" data-parsoid='{\"stx\":\"url\",\"a\":{\"href\":\"http://testing.123?4=5%7C6\"},\"sa\":{\"href\":\"http://testing.123?4=5&amp;vert;6\"},\"dsr\":[22,51,0,0]}'>http://testing.123?4=5%7C6</a>","txt":"http://testing.123?4=5|6"}]],"caption":"caption"}'><a href="./File:Foobar.jpg" class="mw-file-description" title="caption"><img alt="http://testing.123?4=5|6" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a></span></p> |
| 901 |
|
| 902 |
<!-- consistency with gallery extension --> |
| 903 |
<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt5" data-mw='{"name":"gallery","attrs":{},"body":{}}'> |
| 904 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File mw:ExpandedAttrs" data-parsoid='{"optList":[{"ck":"width","ak":"120x120px"},{"ck":"none","ak":"none"},{"ck":"alt","ak":"alt=http://testing.123?4=5&#x7C;6"},{"ck":"caption","ak":"caption"}]}' data-mw='{"attribs":[["alt",{"html":"alt=<a rel=\"mw:ExtLink\" href=\"http://testing.123?4=5%7C6\" class=\"external free\" data-parsoid='{\"stx\":\"url\",\"a\":{\"href\":\"http://testing.123?4=5%7C6\"},\"sa\":{\"href\":\"http://testing.123?4=5&amp;#x7C;6\"},\"dsr\":[200,229,0,0]}'>http://testing.123?4=5%7C6</a>","txt":"http://testing.123?4=5|6"}]]}'><a href="./File:Foobar.jpg" class="mw-file-description" title="caption"><img alt="http://testing.123?4=5|6" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div><div class="gallerytext">caption</div></li> |
| 905 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File mw:ExpandedAttrs" data-parsoid='{"optList":[{"ck":"width","ak":"120x120px"},{"ck":"none","ak":"none"},{"ck":"alt","ak":"alt=http://testing.123?4=5&vert;6"},{"ck":"caption","ak":"caption"}]}' data-mw='{"attribs":[["alt",{"html":"alt=<a rel=\"mw:ExtLink\" href=\"http://testing.123?4=5%7C6\" class=\"external free\" data-parsoid='{\"stx\":\"url\",\"a\":{\"href\":\"http://testing.123?4=5%7C6\"},\"sa\":{\"href\":\"http://testing.123?4=5&amp;vert;6\"},\"dsr\":[137,166,0,0]}'>http://testing.123?4=5%7C6</a>","txt":"http://testing.123?4=5|6"}]]}'><a href="./File:Foobar.jpg" class="mw-file-description" title="caption"><img alt="http://testing.123?4=5|6" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div><div class="gallerytext">caption</div> |
| 906 |
</li> |
| 907 |
</ul> |
| 908 |
!! end |
| 909 |
|
| 910 |
!! test |
| 911 |
Italics markup in alt attribute (T206940) |
| 912 |
!! options |
| 913 |
parsoid=wt2html,html2html |
| 914 |
!! config |
| 915 |
wgParserEnableLegacyMediaDOM=true |
| 916 |
!! wikitext |
| 917 |
[[File:Foobar.jpg|alt=''x''|caption]] |
| 918 |
|
| 919 |
<!-- consistency with gallery extension --> |
| 920 |
<gallery> |
| 921 |
File:Foobar.jpg|alt=''x''|caption |
| 922 |
</gallery> |
| 923 |
!! html/php |
| 924 |
<p><a href="/wiki/File:Foobar.jpg" class="image" title="caption"><img alt="x" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 925 |
</p> |
| 926 |
<ul class="gallery mw-gallery-traditional"> |
| 927 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 928 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image" title="caption"><img alt="x" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 929 |
<div class="gallerytext">caption</div> |
| 930 |
</div></li> |
| 931 |
</ul> |
| 932 |
!! html/parsoid |
| 933 |
<p><span class="mw-default-size" typeof="mw:File mw:ExpandedAttrs" about="#mwt1" data-parsoid='{"optList":[{"ck":"alt","ak":"alt=''x''"},{"ck":"caption","ak":"caption"}]}' data-mw='{"attribs":[["alt",{"html":"alt=<i data-parsoid='{\"dsr\":[22,27,2,2]}'>x</i>","txt":"x"}]],"caption":"caption"}'><a href="./File:Foobar.jpg" class="mw-file-description" title="caption"><img alt="x" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a></span></p> |
| 934 |
|
| 935 |
<!-- consistency with gallery extension --> |
| 936 |
<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt5" data-mw='{"name":"gallery","attrs":{},"body":{}}'> |
| 937 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File mw:ExpandedAttrs" data-mw='{"attribs":[["alt",{"html":"alt=<i data-parsoid='{\"dsr\":[113,118,2,2]}'>x</i>","txt":"x"}]]}'><a href="./File:Foobar.jpg" class="mw-file-description" title="caption"><img alt="x" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div> |
| 938 |
<div class="gallerytext">caption</div> |
| 939 |
</li> |
| 940 |
</ul> |
| 941 |
!! end |
| 942 |
|
| 943 |
!! test |
| 944 |
Nowiki markup in alt attribute (edited html, no data-parsoid) (T206940) |
| 945 |
!! config |
| 946 |
wgParserEnableLegacyMediaDOM=true |
| 947 |
!! wikitext |
| 948 |
[[File:Foobar.jpg|alt=<nowiki>''x''</nowiki>|caption]] |
| 949 |
|
| 950 |
<!-- consistency with gallery extension --> |
| 951 |
<gallery> |
| 952 |
File:Foobar.jpg|alt=<nowiki>''x''</nowiki>|caption |
| 953 |
</gallery> |
| 954 |
!! html/php |
| 955 |
<p><a href="/wiki/File:Foobar.jpg" class="image" title="caption"><img alt="''x''" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 956 |
</p> |
| 957 |
<ul class="gallery mw-gallery-traditional"> |
| 958 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 959 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image" title="caption"><img alt="''x''" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 960 |
<div class="gallerytext">caption</div> |
| 961 |
</div></li> |
| 962 |
</ul> |
| 963 |
!! html/parsoid |
| 964 |
<p><span class="mw-default-size" typeof="mw:File mw:ExpandedAttrs" about="#mwt3" data-mw='{"attribs":[["alt",{"html":"alt=<span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[22,44,8,9]}'>''x''</span>","txt":"''x''"}]],"caption":"caption"}'><a href="./File:Foobar.jpg" class="mw-file-description" title="caption"><img alt="''x''" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a></span></p> |
| 965 |
|
| 966 |
<!-- consistency with gallery extension --> |
| 967 |
<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt9" data-mw='{"name":"gallery","attrs":{},"body":{}}'> |
| 968 |
<li class="gallerybox" style="width: 155px;"> |
| 969 |
<div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File mw:ExpandedAttrs" data-mw='{"attribs":[["alt",{"html":"alt=<span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[130,152,8,9]}'>''x''</span>","txt":"''x''"}]]}'><a href="./File:Foobar.jpg" class="mw-file-description" title="caption"><img alt="''x''" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div> |
| 970 |
<div class="gallerytext">caption</div></li> |
| 971 |
</ul> |
| 972 |
!! end |
| 973 |
|
| 974 |
!! test |
| 975 |
Ampersand in link attribute (edited html, no data-parsoid) (T206940) |
| 976 |
!! config |
| 977 |
wgParserEnableLegacyMediaDOM=true |
| 978 |
!! wikitext |
| 979 |
[[File:Foobar.jpg|link=Foo_&_bar]] |
| 980 |
|
| 981 |
<!-- consistency with gallery extension --> |
| 982 |
<gallery> |
| 983 |
File:Foobar.jpg|link=Foo_&_bar |
| 984 |
</gallery> |
| 985 |
!! html/php |
| 986 |
<p><a href="/wiki/Foo_%26_bar" title="Foo & bar"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 987 |
</p> |
| 988 |
<ul class="gallery mw-gallery-traditional"> |
| 989 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 990 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/Foo_%26_bar" title="Foo & bar"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 991 |
<div class="gallerytext"></div> |
| 992 |
</div></li> |
| 993 |
</ul> |
| 994 |
!! html/parsoid |
| 995 |
<p><span class="mw-default-size" typeof="mw:File"><a href="./Foo_&_bar" title="Foo & bar"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a></span></p> |
| 996 |
|
| 997 |
<!-- consistency with gallery extension --> |
| 998 |
<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" data-mw='{"name":"gallery","attrs":{},"body":{}}'> |
| 999 |
<li class="gallerybox" style="width: 155px;"> |
| 1000 |
<div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File"><a href="./Foo_&_bar" title="Foo & bar"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div> |
| 1001 |
<div class="gallerytext"></div> |
| 1002 |
</li> |
| 1003 |
</ul> |
| 1004 |
!! end |
| 1005 |
|
| 1006 |
!! test |
| 1007 |
Italics markup in link attribute (T206940) |
| 1008 |
!! options |
| 1009 |
parsoid=wt2html,html2html |
| 1010 |
!! config |
| 1011 |
wgParserEnableLegacyMediaDOM=true |
| 1012 |
!! wikitext |
| 1013 |
[[Foo''s bar''s]] |
| 1014 |
|
| 1015 |
<!-- Note that "italics" are stripped, even though this is a valid page title --> |
| 1016 |
[[File:Foobar.jpg|link=Foo''s bar''s|caption1]] |
| 1017 |
|
| 1018 |
[[File:Foobar.jpg|link=''Main Page''|caption2]] |
| 1019 |
|
| 1020 |
<!-- consistency with gallery extension --> |
| 1021 |
<gallery> |
| 1022 |
File:Foobar.jpg|link=Foo''s bar''s|caption1 |
| 1023 |
File:Foobar.jpg|link=''Main Page''|caption2 |
| 1024 |
</gallery> |
| 1025 |
!! html/php |
| 1026 |
<p><a href="/wiki/Foo%27%27s_bar%27%27s" title="Foo''s bar''s">Foo''s bar''s</a> |
| 1027 |
</p><p><a href="/wiki/Foos_bars" title="caption1"><img alt="caption1" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 1028 |
</p><p><a href="/wiki/Main_Page" title="caption2"><img alt="caption2" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 1029 |
</p> |
| 1030 |
<ul class="gallery mw-gallery-traditional"> |
| 1031 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 1032 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/Foos_bars" title="caption1"><img alt="caption1" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 1033 |
<div class="gallerytext">caption1</div> |
| 1034 |
</div></li> |
| 1035 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 1036 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/Main_Page" title="caption2"><img alt="caption2" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 1037 |
<div class="gallerytext">caption2</div> |
| 1038 |
</div></li> |
| 1039 |
</ul> |
| 1040 |
!! html/parsoid |
| 1041 |
<p><a rel="mw:WikiLink" href="./Foo''s_bar''s" title="Foo''s bar''s">Foo''s bar''s</a></p> |
| 1042 |
|
| 1043 |
<!-- Note that "italics" are stripped, even though this is a valid page title --> |
| 1044 |
<p><span class="mw-default-size" typeof="mw:File" data-parsoid='{"optList":[{"ck":"link","ak":"link=Foo''s bar''s"},{"ck":"caption","ak":"caption1"}]}' data-mw='{"caption":"caption1"}'><a href="./Foos_bars" title="caption1" data-parsoid='{"a":{"href":"./Foos_bars"},"sa":{"href":"link=Foo''s bar''s"}}'><img alt="caption1" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"220","width":"1941"},"sa":{"resource":"File:Foobar.jpg"}}' class="mw-file-element"/></a></span></p> |
| 1045 |
|
| 1046 |
<p><span class="mw-default-size" typeof="mw:File" data-parsoid='{"optList":[{"ck":"link","ak":"link=''Main Page''"},{"ck":"caption","ak":"caption2"}]}' data-mw='{"caption":"caption2"}'><a href="./Main_Page" title="caption2" data-parsoid='{"a":{"href":"./Main_Page"},"sa":{"href":"link=''Main Page''"}}'><img alt="caption2" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"220","width":"1941"},"sa":{"resource":"File:Foobar.jpg"}}' class="mw-file-element"/></a></span></p> |
| 1047 |
|
| 1048 |
<!-- consistency with gallery extension --> |
| 1049 |
<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" data-mw='{"name":"gallery","attrs":{},"body":{}}'> |
| 1050 |
<li class="gallerybox" style="width: 155px;"> |
| 1051 |
<div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File"><a href="./Foos_bars" title="caption1"><img alt="caption1" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div> |
| 1052 |
<div class="gallerytext">caption1</div> |
| 1053 |
</li> |
| 1054 |
<li class="gallerybox" style="width: 155px;"> |
| 1055 |
<div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File"><a href="./Main_Page" title="caption2"><img alt="caption2" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div> |
| 1056 |
<div class="gallerytext">caption2</div> |
| 1057 |
</li> |
| 1058 |
</ul> |
| 1059 |
!! end |
| 1060 |
|
| 1061 |
!! test |
| 1062 |
Nowiki markup in link attribute (edited html, no data-parsoid) (T206940) |
| 1063 |
!! config |
| 1064 |
wgParserEnableLegacyMediaDOM=true |
| 1065 |
!! wikitext |
| 1066 |
[[File:Foobar.jpg|link=Foo<nowiki>''s_bar''</nowiki>s|caption]] |
| 1067 |
|
| 1068 |
<!-- consistency with gallery extension --> |
| 1069 |
<gallery> |
| 1070 |
File:Foobar.jpg|link=Foo<nowiki>''s_bar''</nowiki>s|caption |
| 1071 |
</gallery> |
| 1072 |
!! html/php |
| 1073 |
<p><a href="/wiki/Foo%27%27s_bar%27%27s" title="caption"><img alt="caption" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 1074 |
</p> |
| 1075 |
<ul class="gallery mw-gallery-traditional"> |
| 1076 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 1077 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/Foo%27%27s_bar%27%27s" title="caption"><img alt="caption" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 1078 |
<div class="gallerytext">caption</div> |
| 1079 |
</div></li> |
| 1080 |
</ul> |
| 1081 |
!! html/parsoid |
| 1082 |
<p><span class="mw-default-size" typeof="mw:File" data-mw='{"caption":"caption"}'><a href="./Foo''s_bar''s" title="caption"><img alt="caption" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a></span></p> |
| 1083 |
|
| 1084 |
<!-- consistency with gallery extension --> |
| 1085 |
<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" data-mw='{"name":"gallery","attrs":{},"body":{}}'> |
| 1086 |
<li class="gallerybox" style="width: 155px;"> |
| 1087 |
<div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File"><a href="./Foo''s_bar''s" title="caption"><img alt="caption" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div> |
| 1088 |
<div class="gallerytext">caption</div> |
| 1089 |
</li> |
| 1090 |
</ul> |
| 1091 |
!! end |
| 1092 |
|
| 1093 |
!! test |
| 1094 |
HTML entity prefix in link markup (T209236) |
| 1095 |
!! config |
| 1096 |
wgParserEnableLegacyMediaDOM=true |
| 1097 |
!! wikitext |
| 1098 |
[[File:Foobar.jpg|link=https://example.com?foo¶ms=bar]] |
| 1099 |
|
| 1100 |
<!-- consistency with gallery extension --> |
| 1101 |
<gallery> |
| 1102 |
File:Foobar.jpg|link=https://example.com?foo¶ms=bar |
| 1103 |
</gallery> |
| 1104 |
!! html/php |
| 1105 |
<p><a href="https://example.com?foo&params=bar" rel="nofollow"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 1106 |
</p> |
| 1107 |
<ul class="gallery mw-gallery-traditional"> |
| 1108 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 1109 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="https://example.com?foo&params=bar" rel="nofollow"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 1110 |
<div class="gallerytext"></div> |
| 1111 |
</div></li> |
| 1112 |
</ul> |
| 1113 |
!! html/parsoid |
| 1114 |
<p><span class="mw-default-size" typeof="mw:File"><a href="https://example.com?foo&params=bar"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a></span></p> |
| 1115 |
|
| 1116 |
<!-- consistency with gallery extension --> |
| 1117 |
<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" data-mw='{"name":"gallery","attrs":{},"body":{}}'> |
| 1118 |
<li class="gallerybox" style="width: 155px;"> |
| 1119 |
<div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File"><a href="https://example.com?foo&params=bar"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div> |
| 1120 |
<div class="gallerytext"></div> |
| 1121 |
</li> |
| 1122 |
</ul> |
| 1123 |
!! end |
| 1124 |
|
| 1125 |
!! test |
| 1126 |
Image link markup is not generated when redundant (T108504) - encoded href |
| 1127 |
!! options |
| 1128 |
parsoid=html2wt,wt2wt |
| 1129 |
language=sr |
| 1130 |
!! wikitext |
| 1131 |
[[Датотека:Foobar.jpg]] |
| 1132 |
!! html/parsoid |
| 1133 |
<p><span class="mw-default-size" typeof="mw:File"><a href="./%D0%94%D0%B0%D1%82%D0%BE%D1%82%D0%B5%D0%BA%D0%B0:Foobar.jpg"><img resource="./Датотека:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="178" width="172"/></a></span></p> |
| 1134 |
!! end |
| 1135 |
|
| 1136 |
!! test |
| 1137 |
Image with table with attributes in caption |
| 1138 |
!! options |
| 1139 |
parsoid=wt2html,html2html |
| 1140 |
!! wikitext |
| 1141 |
[[File:Foobar.jpg|thumb| |
| 1142 |
{| class="123" | |
| 1143 |
|- class="456" | |
| 1144 |
| ha |
| 1145 |
|} |
| 1146 |
]] |
| 1147 |
!! html/parsoid |
| 1148 |
<figure class="mw-default-size" typeof="mw:File/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"caption","ak":"\n{| class=\"123\" |\n|- class=\"456\" |\n| ha\n|}\n"}]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a><figcaption> |
| 1149 |
<table class="123"> |
| 1150 |
<tbody><tr class="456" data-parsoid='{"startTagSrc":"|-"}'> |
| 1151 |
<td> ha</td></tr> |
| 1152 |
</tbody></table> |
| 1153 |
</figcaption></figure> |
| 1154 |
!! end |
| 1155 |
|
| 1156 |
!! test |
| 1157 |
Image with table with rows from templates in caption |
| 1158 |
!! wikitext |
| 1159 |
[[File:Foobar.jpg|thumb| |
| 1160 |
{| |
| 1161 |
{{1x|{{!}} hi}} |
| 1162 |
|} |
| 1163 |
]] |
| 1164 |
!! html/parsoid |
| 1165 |
<figure class="mw-default-size" typeof="mw:File/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"caption","ak":"\n{|\n{{1x|{{!}} hi}}\n|}\n"}]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a><figcaption> |
| 1166 |
<table> |
| 1167 |
<tbody about="#mwt4" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"1x","href":"./Template:1x"},"params":{"1":{"wt":"{{!}} hi"}},"i":0}}]}'><tr><td> hi</td></tr></tbody> |
| 1168 |
</table> |
| 1169 |
</figcaption></figure> |
| 1170 |
!! end |
| 1171 |
|
| 1172 |
!! test |
| 1173 |
Image with nested tables in caption |
| 1174 |
!! wikitext |
| 1175 |
[[File:Foobar.jpg|thumb|Foo<br /> |
| 1176 |
{| |
| 1177 |
| |
| 1178 |
{| |
| 1179 |
|z |
| 1180 |
|} |
| 1181 |
|} |
| 1182 |
]] |
| 1183 |
!! html/parsoid |
| 1184 |
<figure class="mw-default-size" typeof="mw:File/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"caption","ak":"Foo<br />\n{|\n|\n{|\n|z\n|}\n|}\n"}]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a><figcaption>Foo<br data-parsoid='{"stx":"html","selfClose":true}'/> |
| 1185 |
<table> |
| 1186 |
<tbody><tr><td> |
| 1187 |
<table> |
| 1188 |
<tbody><tr><td>z</td></tr> |
| 1189 |
</tbody></table></td></tr> |
| 1190 |
</tbody></table> |
| 1191 |
</figcaption></figure> |
| 1192 |
!! end |
| 1193 |
|
| 1194 |
!! test |
| 1195 |
Image with heading and horizontal rule in caption |
| 1196 |
!! config |
| 1197 |
wgParserEnableLegacyMediaDOM=true |
| 1198 |
wgParserEnableLegacyHeadingDOM=false |
| 1199 |
!! wikitext |
| 1200 |
[[File:Foobar.jpg|thumb| |
| 1201 |
===Testing=== |
| 1202 |
123 |
| 1203 |
-------------- |
| 1204 |
]] |
| 1205 |
!! html/php |
| 1206 |
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div> <div class="mw-heading mw-heading3"><h3 id="Testing">Testing</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=1" title="Edit section: Testing">edit</a><span class="mw-editsection-bracket">]</span></span></div> 123 <hr /> </div></div></div> |
| 1207 |
!! html/parsoid |
| 1208 |
<figure class="mw-default-size" typeof="mw:File/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"caption","ak":"\n===Testing===\n123\n--------------\n"}]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a><figcaption> |
| 1209 |
<h3 id="Testing">Testing</h3> |
| 1210 |
123 |
| 1211 |
<hr data-parsoid='{"extra_dashes":10}'/> |
| 1212 |
</figcaption></figure> |
| 1213 |
!! end |
| 1214 |
|
| 1215 |
################### |
| 1216 |
# Conflicting image format options. |
| 1217 |
# First option specified should 'win'. |
| 1218 |
# All three cases in each test should be identical. |
| 1219 |
|
| 1220 |
!! test |
| 1221 |
Image with 'frameless' first. |
| 1222 |
!! options |
| 1223 |
parsoid=wt2html,wt2wt,html2html |
| 1224 |
!! config |
| 1225 |
wgParserEnableLegacyMediaDOM=true |
| 1226 |
!! wikitext |
| 1227 |
[[File:Foobar.jpg|frameless|caption]] |
| 1228 |
|
| 1229 |
[[File:Foobar.jpg|frameless|frame|caption]] |
| 1230 |
|
| 1231 |
[[File:Foobar.jpg|frameless|thumb|caption]] |
| 1232 |
|
| 1233 |
[[File:Foobar.jpg|frameless|thumbnail=Thumb.png|caption]] |
| 1234 |
!! html/php |
| 1235 |
<p><a href="/wiki/File:Foobar.jpg" class="image" title="caption"><img alt="caption" 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> |
| 1236 |
</p><p><a href="/wiki/File:Foobar.jpg" class="image" title="caption"><img alt="caption" 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> |
| 1237 |
</p><p><a href="/wiki/File:Foobar.jpg" class="image" title="caption"><img alt="caption" 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> |
| 1238 |
</p><p><a href="/wiki/File:Foobar.jpg" class="image" title="caption"><img alt="caption" 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> |
| 1239 |
</p> |
| 1240 |
!! html/parsoid |
| 1241 |
<p><span class="mw-default-size" typeof="mw:File/Frameless" data-mw='{"caption":"caption"}'><a href="./File:Foobar.jpg" class="mw-file-description" title="caption"><img alt="caption" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a></span></p> |
| 1242 |
|
| 1243 |
<p><span class="mw-default-size" typeof="mw:File/Frameless" data-mw='{"caption":"caption"}'><a href="./File:Foobar.jpg" class="mw-file-description" title="caption"><img alt="caption" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a></span></p> |
| 1244 |
|
| 1245 |
<p><span class="mw-default-size" typeof="mw:File/Frameless" data-mw='{"caption":"caption"}'><a href="./File:Foobar.jpg" class="mw-file-description" title="caption"><img alt="caption" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a></span></p> |
| 1246 |
|
| 1247 |
<p><span class="mw-default-size" typeof="mw:File/Frameless" data-mw='{"caption":"caption"}'><a href="./File:Foobar.jpg" class="mw-file-description" title="caption"><img alt="caption" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a></span></p> |
| 1248 |
!! end |
| 1249 |
|
| 1250 |
!! test |
| 1251 |
Image with 'frame' first. |
| 1252 |
!! options |
| 1253 |
parsoid=wt2html,wt2wt,html2html |
| 1254 |
!! config |
| 1255 |
wgParserEnableLegacyMediaDOM=true |
| 1256 |
!! wikitext |
| 1257 |
[[File:Foobar.jpg|frame|caption]] |
| 1258 |
[[File:Foobar.jpg|frame|frameless|caption]] |
| 1259 |
[[File:Foobar.jpg|frame|thumb|caption]] |
| 1260 |
[[File:Foobar.jpg|frame|thumbnail=Thumb.png|caption]] |
| 1261 |
!! html/php |
| 1262 |
<div class="thumb tright"><div class="thumbinner" style="width:1943px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" class="thumbimage" /></a> <div class="thumbcaption">caption</div></div></div> |
| 1263 |
<div class="thumb tright"><div class="thumbinner" style="width:1943px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" class="thumbimage" /></a> <div class="thumbcaption">caption</div></div></div> |
| 1264 |
<div class="thumb tright"><div class="thumbinner" style="width:1943px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" class="thumbimage" /></a> <div class="thumbcaption">caption</div></div></div> |
| 1265 |
<div class="thumb tright"><div class="thumbinner" style="width:1943px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" class="thumbimage" /></a> <div class="thumbcaption">caption</div></div></div> |
| 1266 |
!! html/parsoid |
| 1267 |
<figure typeof="mw:File/Frame"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a><figcaption>caption</figcaption></figure> |
| 1268 |
<figure typeof="mw:File/Frame"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a><figcaption>caption</figcaption></figure> |
| 1269 |
<figure typeof="mw:File/Frame"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a><figcaption>caption</figcaption></figure> |
| 1270 |
<figure typeof="mw:File/Frame"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a><figcaption>caption</figcaption></figure> |
| 1271 |
!! end |
| 1272 |
|
| 1273 |
!! test |
| 1274 |
Image with 'thumb' first. |
| 1275 |
!! options |
| 1276 |
parsoid=wt2html,wt2wt,html2html |
| 1277 |
!! config |
| 1278 |
wgParserEnableLegacyMediaDOM=true |
| 1279 |
!! wikitext |
| 1280 |
[[File:Foobar.jpg|thumb|caption]] |
| 1281 |
[[File:Foobar.jpg|thumb|frameless|caption]] |
| 1282 |
[[File:Foobar.jpg|thumb|frame|caption]] |
| 1283 |
[[File:Foobar.jpg|thumb|thumbnail=Thumb.png|caption]] |
| 1284 |
!! html/php |
| 1285 |
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>caption</div></div></div> |
| 1286 |
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>caption</div></div></div> |
| 1287 |
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>caption</div></div></div> |
| 1288 |
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>caption</div></div></div> |
| 1289 |
!! html/parsoid |
| 1290 |
<figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a><figcaption>caption</figcaption></figure> |
| 1291 |
<figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a><figcaption>caption</figcaption></figure> |
| 1292 |
<figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a><figcaption>caption</figcaption></figure> |
| 1293 |
<figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a><figcaption>caption</figcaption></figure> |
| 1294 |
!! end |
| 1295 |
|
| 1296 |
!! test |
| 1297 |
Image with 'thumbnail=' first. |
| 1298 |
!! options |
| 1299 |
parsoid=wt2html,wt2wt,html2html |
| 1300 |
!! config |
| 1301 |
wgParserEnableLegacyMediaDOM=true |
| 1302 |
!! wikitext |
| 1303 |
[[File:Foobar.jpg|thumbnail=Thumb.png|caption]] |
| 1304 |
[[File:Foobar.jpg|thumbnail=Thumb.png|frameless|caption]] |
| 1305 |
[[File:Foobar.jpg|thumbnail=Thumb.png|frame|caption]] |
| 1306 |
[[File:Foobar.jpg|thumbnail=Thumb.png|thumb|caption]] |
| 1307 |
!! html/php |
| 1308 |
<div class="thumb tright"><div class="thumbinner" style="width:137px;"><a href="/wiki/File:Foobar.jpg" title="File:Foobar.jpg"><img src="http://example.com/images/e/ea/Thumb.png" decoding="async" width="135" height="135" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>caption</div></div></div> |
| 1309 |
<div class="thumb tright"><div class="thumbinner" style="width:137px;"><a href="/wiki/File:Foobar.jpg" title="File:Foobar.jpg"><img src="http://example.com/images/e/ea/Thumb.png" decoding="async" width="135" height="135" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>caption</div></div></div> |
| 1310 |
<div class="thumb tright"><div class="thumbinner" style="width:137px;"><a href="/wiki/File:Foobar.jpg" title="File:Foobar.jpg"><img src="http://example.com/images/e/ea/Thumb.png" decoding="async" width="135" height="135" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>caption</div></div></div> |
| 1311 |
<div class="thumb tright"><div class="thumbinner" style="width:137px;"><a href="/wiki/File:Foobar.jpg" title="File:Foobar.jpg"><img src="http://example.com/images/e/ea/Thumb.png" decoding="async" width="135" height="135" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>caption</div></div></div> |
| 1312 |
!! html/parsoid |
| 1313 |
<figure typeof="mw:File/Thumb" data-mw='{"attribs":[["manualthumb",{"txt":"Thumb.png"}]]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/e/ea/Thumb.png" decoding="async" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135" class="mw-file-element"/></a><figcaption>caption</figcaption></figure> |
| 1314 |
<figure typeof="mw:File/Thumb" data-mw='{"attribs":[["manualthumb",{"txt":"Thumb.png"}]]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/e/ea/Thumb.png" decoding="async" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135" class="mw-file-element"/></a><figcaption>caption</figcaption></figure> |
| 1315 |
<figure typeof="mw:File/Thumb" data-mw='{"attribs":[["manualthumb",{"txt":"Thumb.png"}]]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/e/ea/Thumb.png" decoding="async" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135" class="mw-file-element"/></a><figcaption>caption</figcaption></figure> |
| 1316 |
<figure typeof="mw:File/Thumb" data-mw='{"attribs":[["manualthumb",{"txt":"Thumb.png"}]]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/e/ea/Thumb.png" decoding="async" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135" class="mw-file-element"/></a><figcaption>caption</figcaption></figure> |
| 1317 |
!! end |
| 1318 |
|
| 1319 |
################### |
| 1320 |
# Image sizing. |
| 1321 |
# See https://www.mediawiki.org/wiki/Help:Images#Size_and_frame |
| 1322 |
# and https://phabricator.wikimedia.org/T64258 |
| 1323 |
# Foobar has actual size of 1941x220 |
| 1324 |
# 1. Thumbs & frameless always reduce, can't be enlarged unless it's |
| 1325 |
# a scalable format. |
| 1326 |
# 2. Framed & manual images always ignore size options; always |
| 1327 |
# render at original size. |
| 1328 |
# 3. "Unspecified format" and border are the only types which can be |
| 1329 |
# enlarged. |
| 1330 |
# 4. The srcset attribute doesn't occur if image is being enlarged |
| 1331 |
|
| 1332 |
!! test |
| 1333 |
Image: unspecified format and border enlarge |
| 1334 |
!! options |
| 1335 |
parsoid=wt2html,wt2wt,html2html |
| 1336 |
!! config |
| 1337 |
wgParserEnableLegacyMediaDOM=true |
| 1338 |
!! wikitext |
| 1339 |
[[File:Foobar.jpg|2000px]] |
| 1340 |
|
| 1341 |
[[File:Foobar.jpg|border|2000px]] |
| 1342 |
!! html/php |
| 1343 |
<p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="2000" height="227" /></a> |
| 1344 |
</p><p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="2000" height="227" class="thumbborder" /></a> |
| 1345 |
</p> |
| 1346 |
!! html/parsoid |
| 1347 |
<p><span typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="227" width="2000" class="mw-file-element"/></a></span></p> |
| 1348 |
<p><span class="mw-image-border" typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="227" width="2000" class="mw-file-element"/></a></span></p> |
| 1349 |
!! end |
| 1350 |
|
| 1351 |
!! test |
| 1352 |
Image: "unspecified format" and border reduce |
| 1353 |
!! options |
| 1354 |
parsoid=wt2html,wt2wt,html2html |
| 1355 |
!! config |
| 1356 |
wgParserEnableLegacyMediaDOM=true |
| 1357 |
!! wikitext |
| 1358 |
[[File:Foobar.jpg|1000px]] |
| 1359 |
|
| 1360 |
[[File:Foobar.jpg|border|1000px]] |
| 1361 |
!! html/php |
| 1362 |
<p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/1000px-Foobar.jpg" decoding="async" width="1000" height="113" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/1500px-Foobar.jpg 1.5x, http://example.com/images/3/3a/Foobar.jpg 2x" /></a> |
| 1363 |
</p><p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/1000px-Foobar.jpg" decoding="async" width="1000" height="113" class="thumbborder" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/1500px-Foobar.jpg 1.5x, http://example.com/images/3/3a/Foobar.jpg 2x" /></a> |
| 1364 |
</p> |
| 1365 |
!! html/parsoid |
| 1366 |
<p><span typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/1000px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="113" width="1000" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/1500px-Foobar.jpg 1.5x, http://example.com/images/3/3a/Foobar.jpg 2x" class="mw-file-element"/></a></span></p> |
| 1367 |
<p><span class="mw-image-border" typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/1000px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="113" width="1000" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/1500px-Foobar.jpg 1.5x, http://example.com/images/3/3a/Foobar.jpg 2x" class="mw-file-element"/></a></span></p> |
| 1368 |
!! end |
| 1369 |
|
| 1370 |
!! test |
| 1371 |
Image: thumbs reduce |
| 1372 |
!! options |
| 1373 |
parsoid=wt2html,wt2wt,html2html |
| 1374 |
!! config |
| 1375 |
wgParserEnableLegacyMediaDOM=true |
| 1376 |
!! wikitext |
| 1377 |
[[File:Foobar.jpg|thumb|50px]] |
| 1378 |
!! html/php |
| 1379 |
<div class="thumb tright"><div class="thumbinner" style="width:52px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg" decoding="async" width="50" height="6" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/75px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/100px-Foobar.jpg 2x" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div></div></div></div> |
| 1380 |
!! html/parsoid |
| 1381 |
<figure typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="6" width="50" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/75px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/100px-Foobar.jpg 2x" class="mw-file-element"/></a><figcaption></figcaption></figure> |
| 1382 |
!! end |
| 1383 |
|
| 1384 |
!! test |
| 1385 |
Image: bitmap thumbs can't be enlarged past original size, but vector can. |
| 1386 |
!! options |
| 1387 |
parsoid=wt2html,wt2wt,html2html |
| 1388 |
!! config |
| 1389 |
wgParserEnableLegacyMediaDOM=true |
| 1390 |
!! wikitext |
| 1391 |
[[File:Foobar.jpg|thumb|2000px]] |
| 1392 |
|
| 1393 |
[[File:Foobar.svg|thumb|2000px]] |
| 1394 |
!! html/php |
| 1395 |
<div class="thumb tright"><div class="thumbinner" style="width:1943px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div></div></div></div> |
| 1396 |
<div class="thumb tright"><div class="thumbinner" style="width:2002px;"><a href="/wiki/File:Foobar.svg" class="image"><img alt="Foobar.svg" src="http://example.com/images/thumb/f/ff/Foobar.svg/2000px-Foobar.svg.png" decoding="async" width="2000" height="1500" class="thumbimage" srcset="http://example.com/images/thumb/f/ff/Foobar.svg/3000px-Foobar.svg.png 1.5x, http://example.com/images/thumb/f/ff/Foobar.svg/4000px-Foobar.svg.png 2x" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.svg" class="internal" title="Enlarge"></a></div></div></div></div> |
| 1397 |
!! html/parsoid |
| 1398 |
<figure typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a><figcaption></figcaption></figure> |
| 1399 |
<figure typeof="mw:File/Thumb"><a href="./File:Foobar.svg" class="mw-file-description"><img resource="./File:Foobar.svg" src="http://example.com/images/thumb/f/ff/Foobar.svg/2000px-Foobar.svg.png" decoding="async" data-file-width="240" data-file-height="180" data-file-type="drawing" height="1500" width="2000" srcset="http://example.com/images/thumb/f/ff/Foobar.svg/3000px-Foobar.svg.png 1.5x, http://example.com/images/thumb/f/ff/Foobar.svg/4000px-Foobar.svg.png 2x" class="mw-file-element"/></a><figcaption></figcaption></figure> |
| 1400 |
!! end |
| 1401 |
|
| 1402 |
!! test |
| 1403 |
Image: frameless can reduce in size |
| 1404 |
!! options |
| 1405 |
parsoid=wt2html,wt2wt,html2html |
| 1406 |
!! config |
| 1407 |
wgParserEnableLegacyMediaDOM=true |
| 1408 |
!! wikitext |
| 1409 |
[[File:Foobar.jpg|frameless|50px]] |
| 1410 |
!! html/php |
| 1411 |
<p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg" decoding="async" width="50" height="6" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/75px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/100px-Foobar.jpg 2x" /></a> |
| 1412 |
</p> |
| 1413 |
!! html/parsoid |
| 1414 |
<p><span typeof="mw:File/Frameless"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="6" width="50" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/75px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/100px-Foobar.jpg 2x" class="mw-file-element"/></a></span></p> |
| 1415 |
!! end |
| 1416 |
|
| 1417 |
!! test |
| 1418 |
Image: bitmap frameless can't be enlarged past original size, but vector can |
| 1419 |
!! options |
| 1420 |
parsoid=wt2html,wt2wt,html2html |
| 1421 |
!! config |
| 1422 |
wgParserEnableLegacyMediaDOM=true |
| 1423 |
!! wikitext |
| 1424 |
[[File:Foobar.jpg|frameless|2000px]] |
| 1425 |
|
| 1426 |
[[File:Foobar.svg|frameless|2000px]] |
| 1427 |
!! html/php |
| 1428 |
<p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 1429 |
</p><p><a href="/wiki/File:Foobar.svg" class="image"><img alt="Foobar.svg" src="http://example.com/images/thumb/f/ff/Foobar.svg/2000px-Foobar.svg.png" decoding="async" width="2000" height="1500" srcset="http://example.com/images/thumb/f/ff/Foobar.svg/3000px-Foobar.svg.png 1.5x, http://example.com/images/thumb/f/ff/Foobar.svg/4000px-Foobar.svg.png 2x" /></a> |
| 1430 |
</p> |
| 1431 |
!! html/parsoid |
| 1432 |
<p><span typeof="mw:File/Frameless"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a></span></p> |
| 1433 |
<p><span typeof="mw:File/Frameless"><a href="./File:Foobar.svg" class="mw-file-description"><img resource="./File:Foobar.svg" src="http://example.com/images/thumb/f/ff/Foobar.svg/2000px-Foobar.svg.png" decoding="async" data-file-width="240" data-file-height="180" data-file-type="drawing" height="1500" width="2000" srcset="http://example.com/images/thumb/f/ff/Foobar.svg/3000px-Foobar.svg.png 1.5x, http://example.com/images/thumb/f/ff/Foobar.svg/4000px-Foobar.svg.png 2x" class="mw-file-element"/></a></span></p> |
| 1434 |
!! end |
| 1435 |
|
| 1436 |
!! test |
| 1437 |
Image: framed images are always unscaled. |
| 1438 |
!! config |
| 1439 |
wgParserEnableLegacyMediaDOM=true |
| 1440 |
!! options |
| 1441 |
parsoid=wt2html,html2html |
| 1442 |
!! wikitext |
| 1443 |
[[File:Foobar.jpg|frame]] |
| 1444 |
|
| 1445 |
[[File:Foobar.jpg|frame|50px]] |
| 1446 |
|
| 1447 |
[[File:Foobar.jpg|frame|50x50px]] |
| 1448 |
|
| 1449 |
[[File:Foobar.jpg|frame|2000px]] |
| 1450 |
!! html/php |
| 1451 |
<div class="thumb tright"><div class="thumbinner" style="width:1943px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" class="thumbimage" /></a> <div class="thumbcaption"></div></div></div> |
| 1452 |
<div class="thumb tright"><div class="thumbinner" style="width:1943px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" class="thumbimage" /></a> <div class="thumbcaption"></div></div></div> |
| 1453 |
<div class="thumb tright"><div class="thumbinner" style="width:1943px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" class="thumbimage" /></a> <div class="thumbcaption"></div></div></div> |
| 1454 |
<div class="thumb tright"><div class="thumbinner" style="width:1943px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" class="thumbimage" /></a> <div class="thumbcaption"></div></div></div> |
| 1455 |
!! html/parsoid |
| 1456 |
<figure typeof="mw:File/Frame"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a><figcaption></figcaption></figure> |
| 1457 |
<figure typeof="mw:File/Frame"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a><figcaption></figcaption></figure> |
| 1458 |
<figure typeof="mw:File/Frame"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a><figcaption></figcaption></figure> |
| 1459 |
<figure typeof="mw:File/Frame"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a><figcaption></figcaption></figure> |
| 1460 |
!! end |
| 1461 |
|
| 1462 |
!! test |
| 1463 |
Image: manualthumb images are always unscaled. |
| 1464 |
!! options |
| 1465 |
parsoid=wt2html,html2html |
| 1466 |
!! config |
| 1467 |
wgParserEnableLegacyMediaDOM=true |
| 1468 |
!! wikitext |
| 1469 |
[[File:Foobar.jpg|thumbnail=Thumb.png]] |
| 1470 |
|
| 1471 |
[[File:Foobar.jpg|thumbnail=Thumb.png|50px]] |
| 1472 |
|
| 1473 |
[[File:Foobar.jpg|thumbnail=Thumb.png|50x50px]] |
| 1474 |
|
| 1475 |
[[File:Foobar.jpg|thumbnail=Thumb.png|2000px]] |
| 1476 |
!! html/php |
| 1477 |
<div class="thumb tright"><div class="thumbinner" style="width:137px;"><a href="/wiki/File:Foobar.jpg" title="File:Foobar.jpg"><img alt="Foobar.jpg" src="http://example.com/images/e/ea/Thumb.png" decoding="async" width="135" height="135" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div></div></div></div> |
| 1478 |
<div class="thumb tright"><div class="thumbinner" style="width:137px;"><a href="/wiki/File:Foobar.jpg" title="File:Foobar.jpg"><img alt="Foobar.jpg" src="http://example.com/images/e/ea/Thumb.png" decoding="async" width="135" height="135" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div></div></div></div> |
| 1479 |
<div class="thumb tright"><div class="thumbinner" style="width:137px;"><a href="/wiki/File:Foobar.jpg" title="File:Foobar.jpg"><img alt="Foobar.jpg" src="http://example.com/images/e/ea/Thumb.png" decoding="async" width="135" height="135" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div></div></div></div> |
| 1480 |
<div class="thumb tright"><div class="thumbinner" style="width:137px;"><a href="/wiki/File:Foobar.jpg" title="File:Foobar.jpg"><img alt="Foobar.jpg" src="http://example.com/images/e/ea/Thumb.png" decoding="async" width="135" height="135" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div></div></div></div> |
| 1481 |
!! html/parsoid |
| 1482 |
<figure typeof="mw:File/Thumb" data-mw='{"attribs":[["manualthumb",{"txt":"Thumb.png"}]]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/e/ea/Thumb.png" decoding="async" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135" class="mw-file-element"/></a><figcaption></figcaption></figure> |
| 1483 |
|
| 1484 |
<figure typeof="mw:File/Thumb" data-mw='{"attribs":[["manualthumb",{"txt":"Thumb.png"}]]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/e/ea/Thumb.png" decoding="async" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135" class="mw-file-element"/></a><figcaption></figcaption></figure> |
| 1485 |
|
| 1486 |
<figure typeof="mw:File/Thumb" data-mw='{"attribs":[["manualthumb",{"txt":"Thumb.png"}]]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/e/ea/Thumb.png" decoding="async" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135" class="mw-file-element"/></a><figcaption></figcaption></figure> |
| 1487 |
|
| 1488 |
<figure typeof="mw:File/Thumb" data-mw='{"attribs":[["manualthumb",{"txt":"Thumb.png"}]]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/e/ea/Thumb.png" decoding="async" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135" class="mw-file-element"/></a><figcaption></figcaption></figure> |
| 1489 |
!! end |
| 1490 |
|
| 1491 |
!! test |
| 1492 |
Bogus sizes during html2wt |
| 1493 |
!! options |
| 1494 |
parsoid=html2wt |
| 1495 |
!! html/parsoid |
| 1496 |
<p><span typeof="mw:File"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/10px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" width="bogus"/></a></span></p> |
| 1497 |
<p><span typeof="mw:File"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/10px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" width="10px"/></a></span></p> |
| 1498 |
!! wikitext |
| 1499 |
[[File:Foobar.jpg]] |
| 1500 |
|
| 1501 |
[[File:Foobar.jpg|10x10px]] |
| 1502 |
!! end |
| 1503 |
|
| 1504 |
################### |
| 1505 |
|
| 1506 |
!! test |
| 1507 |
Link to image page- image page normally doesn't exist, hence edit link |
| 1508 |
Add test with existing image page |
| 1509 |
#<p><a href="/wiki/File:Test" title="Image:Test">Image:test</a> |
| 1510 |
!! config |
| 1511 |
wgParserEnableLegacyMediaDOM=true |
| 1512 |
!! wikitext |
| 1513 |
[[:Image:test]] |
| 1514 |
!! html/php |
| 1515 |
<p><a href="/index.php?title=File:Test&action=edit&redlink=1" class="new" title="File:Test (page does not exist)">Image:test</a> |
| 1516 |
</p> |
| 1517 |
!! html/parsoid |
| 1518 |
<p><a rel="mw:WikiLink" href="./File:Test?action=edit&redlink=1" title="File:Test" class="new" typeof="mw:LocalizedAttrs" data-parsoid='{"stx":"simple","a":{"href":"./File:Test"},"sa":{"href":":Image:test"}}' data-mw-i18n='{"title":{"lang":"x-page","key":"red-link-title","params":["File:Test"]}}'>Image:test</a></p> |
| 1519 |
!! end |
| 1520 |
|
| 1521 |
!! test |
| 1522 |
T20784 Link to non-existent image page with caption should use caption as link text |
| 1523 |
!! config |
| 1524 |
wgParserEnableLegacyMediaDOM=true |
| 1525 |
!! wikitext |
| 1526 |
[[:Image:test|caption]] |
| 1527 |
!! html/php |
| 1528 |
<p><a href="/index.php?title=File:Test&action=edit&redlink=1" class="new" title="File:Test (page does not exist)">caption</a> |
| 1529 |
</p> |
| 1530 |
!! html/parsoid |
| 1531 |
<p><a rel="mw:WikiLink" href="./File:Test?action=edit&redlink=1" title="File:Test" class="new" typeof="mw:LocalizedAttrs" data-parsoid='{"stx":"piped","a":{"href":"./File:Test"},"sa":{"href":":Image:test"}}' data-mw-i18n='{"title":{"lang":"x-page","key":"red-link-title","params":["File:Test"]}}'>caption</a></p> |
| 1532 |
!! end |
| 1533 |
|
| 1534 |
!! test |
| 1535 |
Frameless image caption with a free URL |
| 1536 |
!! config |
| 1537 |
wgParserEnableLegacyMediaDOM=true |
| 1538 |
!! wikitext |
| 1539 |
[[File:Foobar.jpg|http://example.com]] |
| 1540 |
!! html/php |
| 1541 |
<p><a href="/wiki/File:Foobar.jpg" class="image" title="http://example.com"><img alt="http://example.com" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 1542 |
</p> |
| 1543 |
!! html/parsoid |
| 1544 |
<p><span class="mw-default-size" typeof="mw:File" data-parsoid='{"optList":[{"ck":"caption","ak":"http://example.com"}]}' data-mw='{"caption":"<a rel=\"mw:ExtLink\" href=\"http://example.com\" class=\"external free\" data-parsoid='{\"stx\":\"url\",\"dsr\":[18,36,0,0]}'>http://example.com</a>"}'><a href="./File:Foobar.jpg" class="mw-file-description" title="http://example.com"><img alt="http://example.com" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"220","width":"1941"},"sa":{"resource":"File:Foobar.jpg"}}' class="mw-file-element"/></a></span></p> |
| 1545 |
!! end |
| 1546 |
|
| 1547 |
!! test |
| 1548 |
Thumbnail image caption with a free URL |
| 1549 |
!! options |
| 1550 |
thumbsize=220 |
| 1551 |
!! config |
| 1552 |
wgParserEnableLegacyMediaDOM=true |
| 1553 |
!! wikitext |
| 1554 |
[[File:Foobar.jpg|thumb|http://example.com]] |
| 1555 |
!! html/php |
| 1556 |
<div class="thumb tright"><div class="thumbinner" style="width:222px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" decoding="async" width="220" height="25" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a></div></div></div> |
| 1557 |
!! html/parsoid |
| 1558 |
<figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" decoding="async" 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" class="mw-file-element"/></a><figcaption><a rel="mw:ExtLink" href="http://example.com" class="external free">http://example.com</a></figcaption></figure> |
| 1559 |
!! end |
| 1560 |
|
| 1561 |
!! test |
| 1562 |
Thumbnail image caption with a free URL and explicit alt |
| 1563 |
!! options |
| 1564 |
thumbsize=220 |
| 1565 |
parsoid=wt2html,wt2wt,html2html |
| 1566 |
!! config |
| 1567 |
wgParserEnableLegacyMediaDOM=true |
| 1568 |
!! wikitext |
| 1569 |
[[File:Foobar.jpg|thumb|http://example.com|alt=Alteration]] |
| 1570 |
!! html/php |
| 1571 |
<div class="thumb tright"><div class="thumbinner" style="width:222px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Alteration" src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" decoding="async" width="220" height="25" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a></div></div></div> |
| 1572 |
!! html/parsoid |
| 1573 |
<figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img alt="Alteration" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" decoding="async" 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" class="mw-file-element"/></a><figcaption><a rel="mw:ExtLink" href="http://example.com" class="external free">http://example.com</a></figcaption></figure> |
| 1574 |
!! end |
| 1575 |
|
| 1576 |
!! test |
| 1577 |
SVG thumbnails with no language set |
| 1578 |
!! config |
| 1579 |
wgParserEnableLegacyMediaDOM=true |
| 1580 |
!! wikitext |
| 1581 |
[[File:Foobar.svg|thumb|caption]] |
| 1582 |
!! html/php |
| 1583 |
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.svg" class="image"><img src="http://example.com/images/thumb/f/ff/Foobar.svg/180px-Foobar.svg.png" decoding="async" width="180" height="135" class="thumbimage" srcset="http://example.com/images/thumb/f/ff/Foobar.svg/270px-Foobar.svg.png 1.5x, http://example.com/images/thumb/f/ff/Foobar.svg/360px-Foobar.svg.png 2x" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.svg" class="internal" title="Enlarge"></a></div>caption</div></div></div> |
| 1584 |
!! html/parsoid |
| 1585 |
<figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Foobar.svg" class="mw-file-description"><img resource="./File:Foobar.svg" src="http://example.com/images/thumb/f/ff/Foobar.svg/180px-Foobar.svg.png" decoding="async" data-file-width="240" data-file-height="180" data-file-type="drawing" height="135" width="180" srcset="http://example.com/images/thumb/f/ff/Foobar.svg/270px-Foobar.svg.png 1.5x, http://example.com/images/thumb/f/ff/Foobar.svg/360px-Foobar.svg.png 2x" class="mw-file-element"/></a><figcaption>caption</figcaption></figure> |
| 1586 |
!! end |
| 1587 |
|
| 1588 |
!! test |
| 1589 |
SVG thumbnails with language de |
| 1590 |
!! config |
| 1591 |
wgParserEnableLegacyMediaDOM=true |
| 1592 |
!! wikitext |
| 1593 |
[[File:Foobar.svg|lang=de|thumb|caption]] |
| 1594 |
!! html/php |
| 1595 |
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/index.php?title=File:Foobar.svg&lang=de" class="image"><img src="http://example.com/images/thumb/f/ff/Foobar.svg/langde-180px-Foobar.svg.png" decoding="async" width="180" height="135" class="thumbimage" srcset="http://example.com/images/thumb/f/ff/Foobar.svg/langde-270px-Foobar.svg.png 1.5x, http://example.com/images/thumb/f/ff/Foobar.svg/langde-360px-Foobar.svg.png 2x" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.svg?lang=de" class="internal" title="Enlarge"></a></div>caption</div></div></div> |
| 1596 |
!! html/parsoid |
| 1597 |
<figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Foobar.svg?lang=de" class="mw-file-description"><img resource="./File:Foobar.svg" src="http://example.com/images/thumb/f/ff/Foobar.svg/langde-180px-Foobar.svg.png" decoding="async" lang="de" data-file-width="240" data-file-height="180" data-file-type="drawing" height="135" width="180" srcset="http://example.com/images/thumb/f/ff/Foobar.svg/langde-270px-Foobar.svg.png 1.5x, http://example.com/images/thumb/f/ff/Foobar.svg/langde-360px-Foobar.svg.png 2x" class="mw-file-element"/></a><figcaption>caption</figcaption></figure> |
| 1598 |
!! end |
| 1599 |
|
| 1600 |
!! test |
| 1601 |
SVG thumbnails with invalid language code |
| 1602 |
!! config |
| 1603 |
wgParserEnableLegacyMediaDOM=true |
| 1604 |
!! wikitext |
| 1605 |
[[File:Foobar.svg|thumb|caption|lang=invalid:language:code]] |
| 1606 |
!! html/php |
| 1607 |
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.svg" class="image"><img src="http://example.com/images/thumb/f/ff/Foobar.svg/180px-Foobar.svg.png" decoding="async" width="180" height="135" class="thumbimage" srcset="http://example.com/images/thumb/f/ff/Foobar.svg/270px-Foobar.svg.png 1.5x, http://example.com/images/thumb/f/ff/Foobar.svg/360px-Foobar.svg.png 2x" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.svg" class="internal" title="Enlarge"></a></div>lang=invalid:language:code</div></div></div> |
| 1608 |
!! html/parsoid |
| 1609 |
<figure class="mw-default-size" typeof="mw:File/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"caption","ak":"caption"},{"ck":"bogus","ak":"lang=invalid:language:code"}]}' data-mw='{"attribs":[["bogus",{"txt":"invalid:language:code"}]]}'><a href="./File:Foobar.svg" class="mw-file-description"><img resource="./File:Foobar.svg" src="http://example.com/images/thumb/f/ff/Foobar.svg/180px-Foobar.svg.png" decoding="async" data-file-width="240" data-file-height="180" data-file-type="drawing" height="135" width="180" srcset="http://example.com/images/thumb/f/ff/Foobar.svg/270px-Foobar.svg.png 1.5x, http://example.com/images/thumb/f/ff/Foobar.svg/360px-Foobar.svg.png 2x" class="mw-file-element"/></a><figcaption>caption</figcaption></figure> |
| 1610 |
!! end |
| 1611 |
|
| 1612 |
!! test |
| 1613 |
SVG thumbnails in page language |
| 1614 |
!! options |
| 1615 |
title=Rupage |
| 1616 |
language=ru |
| 1617 |
!! config |
| 1618 |
wgParserEnableLegacyMediaDOM=true |
| 1619 |
!! wikitext |
| 1620 |
[[Файл:Foobar.svg]] [[Файл:Foobar.svg|lang=en]] |
| 1621 |
!! html/php |
| 1622 |
<p><a href="/wiki/%D0%A4%D0%B0%D0%B9%D0%BB:Foobar.svg" class="image"><img alt="Foobar.svg" src="http://example.com/images/thumb/f/ff/Foobar.svg/langru-240px-Foobar.svg.png" decoding="async" width="240" height="180" srcset="http://example.com/images/thumb/f/ff/Foobar.svg/langru-360px-Foobar.svg.png 1.5x, http://example.com/images/thumb/f/ff/Foobar.svg/langru-480px-Foobar.svg.png 2x" /></a> <a href="/index.php?title=%D0%A4%D0%B0%D0%B9%D0%BB:Foobar.svg&lang=en" class="image"><img alt="Foobar.svg" src="http://example.com/images/thumb/f/ff/Foobar.svg/240px-Foobar.svg.png" decoding="async" width="240" height="180" srcset="http://example.com/images/thumb/f/ff/Foobar.svg/360px-Foobar.svg.png 1.5x, http://example.com/images/thumb/f/ff/Foobar.svg/480px-Foobar.svg.png 2x" /></a> |
| 1623 |
</p> |
| 1624 |
!! html/parsoid |
| 1625 |
<p><span class="mw-default-size" typeof="mw:File"><a href="./Файл:Foobar.svg" class="mw-file-description"><img resource="./Файл:Foobar.svg" src="http://example.com/images/thumb/f/ff/Foobar.svg/langru-240px-Foobar.svg.png" decoding="async" data-file-width="240" data-file-height="180" data-file-type="drawing" height="180" width="240" srcset="http://example.com/images/thumb/f/ff/Foobar.svg/langru-360px-Foobar.svg.png 1.5x, http://example.com/images/thumb/f/ff/Foobar.svg/langru-480px-Foobar.svg.png 2x" class="mw-file-element"/></a></span> <span class="mw-default-size" typeof="mw:File"><a href="./Файл:Foobar.svg?lang=en" class="mw-file-description"><img resource="./Файл:Foobar.svg" src="http://example.com/images/thumb/f/ff/Foobar.svg/240px-Foobar.svg.png" decoding="async" lang="en" data-file-width="240" data-file-height="180" data-file-type="drawing" height="180" width="240" srcset="http://example.com/images/thumb/f/ff/Foobar.svg/360px-Foobar.svg.png 1.5x, http://example.com/images/thumb/f/ff/Foobar.svg/480px-Foobar.svg.png 2x" class="mw-file-element"/></a></span></p> |
| 1626 |
!! end |
| 1627 |
|
| 1628 |
!! test |
| 1629 |
SVG thumbnails in page language not present in the file |
| 1630 |
!! options |
| 1631 |
title=Depage |
| 1632 |
language=de |
| 1633 |
!! config |
| 1634 |
wgParserEnableLegacyMediaDOM=true |
| 1635 |
!! wikitext |
| 1636 |
[[Datei:Foobar.svg]] [[Datei:Foobar.svg|sprache=ru]] |
| 1637 |
!! html/php |
| 1638 |
<p><a href="/wiki/Datei:Foobar.svg" class="image"><img alt="Foobar.svg" src="http://example.com/images/thumb/f/ff/Foobar.svg/240px-Foobar.svg.png" decoding="async" width="240" height="180" srcset="http://example.com/images/thumb/f/ff/Foobar.svg/360px-Foobar.svg.png 1.5x, http://example.com/images/thumb/f/ff/Foobar.svg/480px-Foobar.svg.png 2x" /></a> <a href="/index.php?title=Datei:Foobar.svg&lang=ru" class="image"><img alt="Foobar.svg" src="http://example.com/images/thumb/f/ff/Foobar.svg/langru-240px-Foobar.svg.png" decoding="async" width="240" height="180" srcset="http://example.com/images/thumb/f/ff/Foobar.svg/langru-360px-Foobar.svg.png 1.5x, http://example.com/images/thumb/f/ff/Foobar.svg/langru-480px-Foobar.svg.png 2x" /></a> |
| 1639 |
</p> |
| 1640 |
!! html/parsoid |
| 1641 |
<p><span class="mw-default-size" typeof="mw:File"><a href="./Datei:Foobar.svg" class="mw-file-description"><img resource="./Datei:Foobar.svg" src="http://example.com/images/thumb/f/ff/Foobar.svg/240px-Foobar.svg.png" decoding="async" data-file-width="240" data-file-height="180" data-file-type="drawing" height="180" width="240" srcset="http://example.com/images/thumb/f/ff/Foobar.svg/360px-Foobar.svg.png 1.5x, http://example.com/images/thumb/f/ff/Foobar.svg/480px-Foobar.svg.png 2x" class="mw-file-element"/></a></span> <span class="mw-default-size" typeof="mw:File"><a href="./Datei:Foobar.svg?lang=ru" class="mw-file-description"><img resource="./Datei:Foobar.svg" src="http://example.com/images/thumb/f/ff/Foobar.svg/langru-240px-Foobar.svg.png" decoding="async" lang="ru" data-file-width="240" data-file-height="180" data-file-type="drawing" height="180" width="240" srcset="http://example.com/images/thumb/f/ff/Foobar.svg/langru-360px-Foobar.svg.png 1.5x, http://example.com/images/thumb/f/ff/Foobar.svg/langru-480px-Foobar.svg.png 2x" class="mw-file-element"/></a></span></p> |
| 1642 |
!! end |
| 1643 |
|
| 1644 |
!! test |
| 1645 |
T3887: A ISBN with a thumbnail |
| 1646 |
!! config |
| 1647 |
wgParserEnableLegacyMediaDOM=true |
| 1648 |
!! wikitext |
| 1649 |
[[File:Foobar.jpg|thumb|ISBN 1235467890]] |
| 1650 |
!! html/php |
| 1651 |
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div><a href="/wiki/Special:BookSources/1235467890" class="internal mw-magiclink-isbn">ISBN 1235467890</a></div></div></div> |
| 1652 |
!! html/parsoid |
| 1653 |
<figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a><figcaption><a href="./Special:BookSources/1235467890" rel="mw:WikiLink">ISBN 1235467890</a></figcaption></figure> |
| 1654 |
!! end |
| 1655 |
|
| 1656 |
!! test |
| 1657 |
T3887: A RFC with a thumbnail |
| 1658 |
!! config |
| 1659 |
wgParserEnableLegacyMediaDOM=true |
| 1660 |
!! wikitext |
| 1661 |
[[File:Foobar.jpg|thumb|This is RFC 12354]] |
| 1662 |
!! html/php |
| 1663 |
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>This is <a class="external mw-magiclink-rfc" rel="nofollow" href="https://datatracker.ietf.org/doc/html/rfc12354">RFC 12354</a></div></div></div> |
| 1664 |
!! html/parsoid |
| 1665 |
<figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a><figcaption>This is <a href="https://datatracker.ietf.org/doc/html/rfc12354" rel="mw:ExtLink" class="external mw-magiclink">RFC 12354</a></figcaption></figure> |
| 1666 |
!! end |
| 1667 |
|
| 1668 |
!! test |
| 1669 |
T3887: A mailto link with a thumbnail |
| 1670 |
!! config |
| 1671 |
wgParserEnableLegacyMediaDOM=true |
| 1672 |
!! wikitext |
| 1673 |
[[File:Foobar.jpg|thumb|Please mailto:[email protected]]] |
| 1674 |
!! html/php |
| 1675 |
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>Please <a rel="nofollow" class="external free" href="mailto:[email protected]">mailto:[email protected]</a></div></div></div> |
| 1676 |
!! html/parsoid |
| 1677 |
<figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a><figcaption>Please <a rel="mw:ExtLink" href="mailto:[email protected]" class="external free">mailto:[email protected]</a></figcaption></figure> |
| 1678 |
!! end |
| 1679 |
|
| 1680 |
# Pending resolution to T2368 |
| 1681 |
!! test |
| 1682 |
T2648: Frameless image caption with a link |
| 1683 |
!! config |
| 1684 |
wgParserEnableLegacyMediaDOM=true |
| 1685 |
!! wikitext |
| 1686 |
[[File:Foobar.jpg|text with a [[link]] in it]] |
| 1687 |
!! html/php |
| 1688 |
<p><a href="/wiki/File:Foobar.jpg" class="image" title="text with a link in it"><img alt="text with a link in it" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 1689 |
</p> |
| 1690 |
!! html/parsoid |
| 1691 |
<p><span class="mw-default-size" typeof="mw:File" data-parsoid='{"optList":[{"ck":"caption","ak":"text with a [[link]] in it"}]}' data-mw='{"caption":"text with a <a rel=\"mw:WikiLink\" href=\"./Link\" title=\"Link\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"./Link\"},\"sa\":{\"href\":\"link\"},\"dsr\":[30,38,2,2]}'>link</a> in it"}'><a href="./File:Foobar.jpg" class="mw-file-description" title="text with a link in it"><img alt="text with a link in it" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"220","width":"1941"},"sa":{"resource":"File:Foobar.jpg"}}' class="mw-file-element"/></a></span></p> |
| 1692 |
!! end |
| 1693 |
|
| 1694 |
!! test |
| 1695 |
T2648: Frameless image caption with a link (suffix) |
| 1696 |
!! config |
| 1697 |
wgParserEnableLegacyMediaDOM=true |
| 1698 |
!! wikitext |
| 1699 |
[[File:Foobar.jpg|text with a [[link]]foo in it]] |
| 1700 |
!! html/php |
| 1701 |
<p><a href="/wiki/File:Foobar.jpg" class="image" title="text with a linkfoo in it"><img alt="text with a linkfoo in it" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 1702 |
</p> |
| 1703 |
!! html/parsoid |
| 1704 |
<p><span class="mw-default-size" typeof="mw:File" data-parsoid='{"optList":[{"ck":"caption","ak":"text with a [[link]]foo in it"}]}' data-mw='{"caption":"text with a <a rel=\"mw:WikiLink\" href=\"./Link\" title=\"Link\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"./Link\"},\"sa\":{\"href\":\"link\"},\"dsr\":[30,41,2,5],\"tail\":\"foo\"}'>linkfoo</a> in it"}'><a href="./File:Foobar.jpg" class="mw-file-description" title="text with a linkfoo in it"><img alt="text with a linkfoo in it" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"220","width":"1941"},"sa":{"resource":"File:Foobar.jpg"}}' class="mw-file-element"/></a></span></p> |
| 1705 |
!! end |
| 1706 |
|
| 1707 |
!! test |
| 1708 |
T2648: Frameless image caption with an interwiki link |
| 1709 |
!! config |
| 1710 |
wgParserEnableLegacyMediaDOM=true |
| 1711 |
!! wikitext |
| 1712 |
[[File:Foobar.jpg|text with a [[MeatBall:Link]] in it]] |
| 1713 |
!! html/php |
| 1714 |
<p><a href="/wiki/File:Foobar.jpg" class="image" title="text with a MeatBall:Link in it"><img alt="text with a MeatBall:Link in it" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 1715 |
</p> |
| 1716 |
!! html/parsoid |
| 1717 |
<p><span class="mw-default-size" typeof="mw:File" data-parsoid='{"optList":[{"ck":"caption","ak":"text with a [[MeatBall:Link]] in it"}]}' data-mw='{"caption":"text with a <a rel=\"mw:WikiLink/Interwiki\" href=\"http://www.usemod.com/cgi-bin/mb.pl?Link\" title=\"meatball:Link\" class=\"extiw\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"http://www.usemod.com/cgi-bin/mb.pl?Link\"},\"sa\":{\"href\":\"MeatBall:Link\"},\"isIW\":true,\"dsr\":[30,47,2,2]}'>MeatBall:Link</a> in it"}'><a href="./File:Foobar.jpg" class="mw-file-description" title="text with a MeatBall:Link in it"><img alt="text with a MeatBall:Link in it" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"220","width":"1941"},"sa":{"resource":"File:Foobar.jpg"}}' class="mw-file-element"/></a></span></p> |
| 1718 |
!! end |
| 1719 |
|
| 1720 |
!! test |
| 1721 |
T2648: Frameless image caption with a piped interwiki link |
| 1722 |
!! config |
| 1723 |
wgParserEnableLegacyMediaDOM=true |
| 1724 |
!! wikitext |
| 1725 |
[[File:Foobar.jpg|text with a [[MeatBall:Link|link]] in it]] |
| 1726 |
!! html/php |
| 1727 |
<p><a href="/wiki/File:Foobar.jpg" class="image" title="text with a link in it"><img alt="text with a link in it" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 1728 |
</p> |
| 1729 |
!! html/parsoid |
| 1730 |
<p><span class="mw-default-size" typeof="mw:File" data-parsoid='{"optList":[{"ck":"caption","ak":"text with a [[MeatBall:Link|link]] in it"}]}' data-mw='{"caption":"text with a <a rel=\"mw:WikiLink/Interwiki\" href=\"http://www.usemod.com/cgi-bin/mb.pl?Link\" title=\"meatball:Link\" class=\"extiw\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"http://www.usemod.com/cgi-bin/mb.pl?Link\"},\"sa\":{\"href\":\"MeatBall:Link\"},\"isIW\":true,\"dsr\":[30,52,16,2]}'>link</a> in it"}'><a href="./File:Foobar.jpg" class="mw-file-description" title="text with a link in it"><img alt="text with a link in it" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"220","width":"1941"},"sa":{"resource":"File:Foobar.jpg"}}' class="mw-file-element"/></a></span></p> |
| 1731 |
!! end |
| 1732 |
|
| 1733 |
!! test |
| 1734 |
T107474: Frameless image caption with <nowiki> |
| 1735 |
!! wikitext |
| 1736 |
[[File:Foobar.jpg|<nowiki>text with a [[MeatBall:Link|link]] in it</nowiki>]] |
| 1737 |
!! html/parsoid |
| 1738 |
<p><span class="mw-default-size" typeof="mw:File" data-parsoid='{"optList":[{"ck":"caption","ak":"<nowiki>text with a [[MeatBall:Link|link]] in it</nowiki>"}]}' data-mw='{"caption":"<span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[18,75,8,9]}'>text with a [[MeatBall:Link|link]] in it</span>"}'><a href="./File:Foobar.jpg" class="mw-file-description" title="text with a [[MeatBall:Link|link]] in it"><img alt="text with a [[MeatBall:Link|link]] in it" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"220","width":"1941"},"sa":{"resource":"File:Foobar.jpg"}}' class="mw-file-element"/></a></span></p> |
| 1739 |
!! end |
| 1740 |
|
| 1741 |
!! test |
| 1742 |
Escape HTML special chars in image alt text |
| 1743 |
!! config |
| 1744 |
wgParserEnableLegacyMediaDOM=true |
| 1745 |
!! wikitext |
| 1746 |
[[File:Foobar.jpg|& < > "]] |
| 1747 |
!! html/php |
| 1748 |
<p><a href="/wiki/File:Foobar.jpg" class="image" title="& < > ""><img alt="& < > "" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 1749 |
</p> |
| 1750 |
!! html/parsoid |
| 1751 |
<p><span class="mw-default-size" typeof="mw:File" data-parsoid='{"optList":[{"ck":"caption","ak":"& < > \""}]}' data-mw='{"caption":"&amp; &lt; > \""}'><a href="./File:Foobar.jpg" class="mw-file-description" title='& < > "'><img alt='& < > "' resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"220","width":"1941"},"sa":{"resource":"File:Foobar.jpg"}}' class="mw-file-element"/></a></span></p> |
| 1752 |
!! end |
| 1753 |
|
| 1754 |
!! test |
| 1755 |
Escape HTML special chars in image alt text with LanguageConverter |
| 1756 |
!! options |
| 1757 |
language=zh |
| 1758 |
!! config |
| 1759 |
wgParserEnableLegacyMediaDOM=true |
| 1760 |
!! wikitext |
| 1761 |
[[File:Foobar.jpg|& < > "]] |
| 1762 |
!! html/php |
| 1763 |
<p><a href="/wiki/File:Foobar.jpg" class="image" title="& < > ""><img alt="& < > "" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 1764 |
</p> |
| 1765 |
!! html/parsoid |
| 1766 |
<p><span class="mw-default-size" typeof="mw:File" data-parsoid='{"optList":[{"ck":"caption","ak":"& < > \""}]}' data-mw='{"caption":"&amp; &lt; > \""}'><a href="./File:Foobar.jpg" class="mw-file-description" title='& < > "'><img alt='& < > "' resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"220","width":"1941"},"sa":{"resource":"File:Foobar.jpg"}}' class="mw-file-element"/></a></span></p> |
| 1767 |
!! end |
| 1768 |
|
| 1769 |
!! test |
| 1770 |
Entities in file name and attributes |
| 1771 |
!! config |
| 1772 |
wgParserEnableLegacyMediaDOM=true |
| 1773 |
!! wikitext |
| 1774 |
[[File:7%25 solution.gif|manualthumb=7%25 solution.gif|link=7%25 solution|[[7%25 solution]]]] |
| 1775 |
!! html/php |
| 1776 |
<p><a href="/index.php?title=Special:Upload&wpDestFile=7%25_solution.gif" class="new" title="File:7% solution.gif">7% solution</a> |
| 1777 |
</p> |
| 1778 |
!! html/parsoid |
| 1779 |
<p><span class="mw-default-size" typeof="mw:Error mw:File" data-parsoid='{"optList":[{"ck":"bogus","ak":"manualthumb=7%25 solution.gif"},{"ck":"link","ak":"link=7%25 solution"},{"ck":"caption","ak":"[[7%25 solution]]"}]}' data-mw='{"attribs":[["link",{"txt":"7%25 solution"}]],"caption":"<a rel=\"mw:WikiLink\" href=\"./7%25_solution\" title=\"7% solution\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"./7%25_solution\"},\"sa\":{\"href\":\"7%25 solution\"},\"dsr\":[74,91,2,2]}'>7% solution</a>","errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/7%25_solution.gif"><span class="mw-file-element mw-broken-media" resource="./File:7%25_solution.gif" data-parsoid='{"a":{"resource":"./File:7%25_solution.gif"},"sa":{"resource":"File:7%25 solution.gif"}}'>7% solution</span></a></span></p> |
| 1780 |
!! end |
| 1781 |
|
| 1782 |
!! test |
| 1783 |
T2499: Alt text should have Ӓ, not &1234; |
| 1784 |
!! config |
| 1785 |
wgParserEnableLegacyMediaDOM=true |
| 1786 |
!! wikitext |
| 1787 |
[[File:Foobar.jpg|♀]] |
| 1788 |
!! html/php |
| 1789 |
<p><a href="/wiki/File:Foobar.jpg" class="image" title="♀"><img alt="♀" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 1790 |
</p> |
| 1791 |
!! html/parsoid |
| 1792 |
<p><span class="mw-default-size" typeof="mw:File" data-parsoid='{"optList":[{"ck":"caption","ak":"&#9792;"}]}' data-mw='{"caption":"<span typeof=\"mw:Entity\" data-parsoid='{\"src\":\"&amp;#9792;\",\"srcContent\":\"♀\",\"dsr\":[18,25,null,null]}'>♀</span>"}'><a href="./File:Foobar.jpg" class="mw-file-description" title="♀"><img alt="♀" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"220","width":"1941"},"sa":{"resource":"File:Foobar.jpg"}}' class="mw-file-element"/></a></span></p> |
| 1793 |
!! end |
| 1794 |
|
| 1795 |
!! test |
| 1796 |
Broken image caption with link |
| 1797 |
!! options |
| 1798 |
parsoid=wt2html,wt2wt,html2html |
| 1799 |
!! config |
| 1800 |
wgParserEnableLegacyMediaDOM=true |
| 1801 |
!! wikitext |
| 1802 |
[[Image:Foobar.jpg|thumb|This is a broken caption. But [[Main Page|this]] is just an ordinary link. |
| 1803 |
!! html/php |
| 1804 |
<p>[[Image:Foobar.jpg|thumb|This is a broken caption. But <a href="/wiki/Main_Page" title="Main Page">this</a> is just an ordinary link. |
| 1805 |
</p> |
| 1806 |
!! html/parsoid |
| 1807 |
<p>[[Image:Foobar.jpg|thumb|This is a broken caption. But <a rel="mw:WikiLink" href="./Main_Page" title="Main Page">this</a> is just an ordinary link.</p> |
| 1808 |
!! end |
| 1809 |
|
| 1810 |
!! test |
| 1811 |
Image caption containing another image |
| 1812 |
!! config |
| 1813 |
wgParserEnableLegacyMediaDOM=true |
| 1814 |
!! wikitext |
| 1815 |
[[File:Foobar.jpg|thumb|This is a caption with another [[File:Thumb.png|image]] inside it!]] |
| 1816 |
!! html/php |
| 1817 |
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>This is a caption with another <a href="/wiki/File:Thumb.png" class="image" title="image"><img alt="image" src="http://example.com/images/e/ea/Thumb.png" decoding="async" width="135" height="135" /></a> inside it!</div></div></div> |
| 1818 |
!! html/parsoid |
| 1819 |
<figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a><figcaption>This is a caption with another <span class="mw-default-size" typeof="mw:File" data-mw='{"caption":"image"}'><a href="./File:Thumb.png" class="mw-file-description" title="image"><img alt="image" resource="./File:Thumb.png" src="http://example.com/images/e/ea/Thumb.png" decoding="async" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135" class="mw-file-element"/></a></span> inside it!</figcaption></figure> |
| 1820 |
!! end |
| 1821 |
|
| 1822 |
!! test |
| 1823 |
Image: caption containing a newline |
| 1824 |
!! config |
| 1825 |
wgParserEnableLegacyMediaDOM=true |
| 1826 |
!! wikitext |
| 1827 |
[[File:Foobar.jpg|This |
| 1828 |
*is some text]] |
| 1829 |
!! html/php |
| 1830 |
<p><a href="/wiki/File:Foobar.jpg" class="image" title="This *is some text"><img alt="This *is some text" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 1831 |
</p> |
| 1832 |
!! html/parsoid |
| 1833 |
<p><span class="mw-default-size" typeof="mw:File" data-mw='{"caption":"This\n*is some text"}'><a href="./File:Foobar.jpg" class="mw-file-description" title="This |
| 1834 |
*is some text"><img alt="This |
| 1835 |
*is some text" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a></span></p> |
| 1836 |
!!end |
| 1837 |
|
| 1838 |
## The leading space should not trigger nowiki escaping in wt2wt mode |
| 1839 |
!! test |
| 1840 |
Image: caption containing leading space |
| 1841 |
!! config |
| 1842 |
wgParserEnableLegacyMediaDOM=true |
| 1843 |
!! wikitext |
| 1844 |
[[File:Foobar.jpg|thumb| bar]] |
| 1845 |
!! html/php |
| 1846 |
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div> bar</div></div></div> |
| 1847 |
!! html/parsoid |
| 1848 |
<figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a><figcaption> bar</figcaption></figure> |
| 1849 |
!! end |
| 1850 |
|
| 1851 |
# html/php output not have newlines after table, td, th, etc. because |
| 1852 |
# Linker::makeThumbLink2() replaces the newlines with spaces since |
| 1853 |
# the table is inside a caption. |
| 1854 |
# FIXME: Verify if that circa 2004 fix is still required. |
| 1855 |
!! test |
| 1856 |
Image: caption containing a table |
| 1857 |
!! options |
| 1858 |
parsoid=wt2html,wt2wt,html2html |
| 1859 |
!! config |
| 1860 |
wgParserEnableLegacyMediaDOM=true |
| 1861 |
!! wikitext |
| 1862 |
[[Image:Foobar.jpg|thumb|200px|This is an example image thumbnail caption with a table |
| 1863 |
{| |
| 1864 |
!Foo!!Bar |
| 1865 |
|- |
| 1866 |
|Foo1||Bar1 |
| 1867 |
|} |
| 1868 |
and some more text.]] |
| 1869 |
!! html/php |
| 1870 |
<div class="thumb tright"><div class="thumbinner" style="width:202px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" decoding="async" width="200" height="23" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/400px-Foobar.jpg 2x" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>This is an example image thumbnail caption with a table <table> <tbody><tr> <th>Foo</th> <th>Bar </th></tr> <tr> <td>Foo1</td> <td>Bar1 </td></tr></tbody></table> and some more text.</div></div></div> |
| 1871 |
!! html/parsoid |
| 1872 |
<figure typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="23" width="200" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/400px-Foobar.jpg 2x" class="mw-file-element"/></a><figcaption>This is an example image thumbnail caption with a table |
| 1873 |
<table> |
| 1874 |
<tbody> |
| 1875 |
<tr><th>Foo</th><th>Bar</th></tr> |
| 1876 |
<tr> |
| 1877 |
<td>Foo1</td> |
| 1878 |
<td>Bar1</td></tr></tbody></table>and some more text.</figcaption></figure> |
| 1879 |
!! end |
| 1880 |
|
| 1881 |
!! test |
| 1882 |
T5090: External links other than http: in image captions |
| 1883 |
!! config |
| 1884 |
wgParserEnableLegacyMediaDOM=true |
| 1885 |
!! wikitext |
| 1886 |
[[File:Foobar.jpg|thumb|200x200px|This caption has [irc://example.net irc] and [https://example.com Secure] ext links in it.]] |
| 1887 |
!! html/php |
| 1888 |
<div class="thumb tright"><div class="thumbinner" style="width:202px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" decoding="async" width="200" height="23" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/400px-Foobar.jpg 2x" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>This caption has <a rel="nofollow" class="external text" href="irc://example.net">irc</a> and <a rel="nofollow" class="external text" href="https://example.com">Secure</a> ext links in it.</div></div></div> |
| 1889 |
!! html/parsoid |
| 1890 |
<figure typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="23" width="200" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/400px-Foobar.jpg 2x" class="mw-file-element"/></a><figcaption>This caption has <a rel="mw:ExtLink" href="irc://example.net" class="external text">irc</a> and <a rel="mw:ExtLink" href="https://example.com" class="external text">Secure</a> ext links in it.</figcaption></figure> |
| 1891 |
!! end |
| 1892 |
|
| 1893 |
!! test |
| 1894 |
Custom class |
| 1895 |
!! options |
| 1896 |
parsoid=wt2html,wt2wt,html2html |
| 1897 |
!! config |
| 1898 |
wgParserEnableLegacyMediaDOM=true |
| 1899 |
!! wikitext |
| 1900 |
[[Image:foobar.jpg|a|class=b]] |
| 1901 |
!! html/php |
| 1902 |
<p><a href="/wiki/File:Foobar.jpg" class="image" title="a"><img alt="a" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" class="b" /></a> |
| 1903 |
</p> |
| 1904 |
!! html/parsoid |
| 1905 |
<p><span class="mw-default-size b" typeof="mw:File" data-mw='{"caption":"a"}'><a href="./File:Foobar.jpg" class="mw-file-description" title="a"><img alt="a" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a></span></p> |
| 1906 |
!! end |
| 1907 |
|
| 1908 |
!! test |
| 1909 |
Localized image handling (1). |
| 1910 |
!! options |
| 1911 |
parsoid=wt2html,wt2wt,html2html |
| 1912 |
language=es |
| 1913 |
!! config |
| 1914 |
wgParserEnableLegacyMediaDOM=true |
| 1915 |
!! wikitext |
| 1916 |
[[Archivo:Foobar.jpg|izquierda|enlace=foo|caption]] |
| 1917 |
!! html/php |
| 1918 |
<div class="floatleft"><a href="/wiki/Foo" title="caption"><img alt="caption" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a></div> |
| 1919 |
!! html/parsoid |
| 1920 |
<figure class="mw-default-size mw-halign-left" typeof="mw:File"><a href="./Foo" title="caption"><img alt="caption" resource="./Archivo:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a><figcaption>caption</figcaption></figure> |
| 1921 |
!! end |
| 1922 |
|
| 1923 |
!! test |
| 1924 |
Localized image handling (2). |
| 1925 |
!! options |
| 1926 |
thumbsize=220 |
| 1927 |
parsoid=wt2html,wt2wt,html2html |
| 1928 |
language=es |
| 1929 |
!! config |
| 1930 |
wgParserEnableLegacyMediaDOM=true |
| 1931 |
!! wikitext |
| 1932 |
[[Archivo:Foobar.jpg|miniatura|izquierda|enlace=foo|caption]] |
| 1933 |
!! html/php |
| 1934 |
<div class="thumb tleft"><div class="thumbinner" style="width:222px;"><a href="/wiki/Foo" title="Foo"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" decoding="async" width="220" height="25" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/Archivo:Foobar.jpg" class="internal" title="Aumentar"></a></div>caption</div></div></div> |
| 1935 |
!! html/parsoid |
| 1936 |
<figure class="mw-default-size mw-halign-left" typeof="mw:File/Thumb"><a href="./Foo" title="Foo"><img resource="./Archivo:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" decoding="async" 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" class="mw-file-element"/></a><figcaption>caption</figcaption></figure> |
| 1937 |
!! end |
| 1938 |
|
| 1939 |
!! test |
| 1940 |
Localized image handling (3). |
| 1941 |
!! options |
| 1942 |
language=fa |
| 1943 |
parsoid=html2wt |
| 1944 |
!! html/parsoid |
| 1945 |
<figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="25" width="220"/></a></figure> |
| 1946 |
!! wikitext |
| 1947 |
[[File:Foobar.jpg|بندانگشتی]] |
| 1948 |
!! end |
| 1949 |
|
| 1950 |
!! test |
| 1951 |
"border", "frameless" and "class" attributes on an image. |
| 1952 |
!! options |
| 1953 |
thumbsize=220 |
| 1954 |
parsoid=wt2html,wt2wt,html2html |
| 1955 |
!! config |
| 1956 |
wgParserEnableLegacyMediaDOM=true |
| 1957 |
!! wikitext |
| 1958 |
[[File:Foobar.jpg|frameless|border|class=extra|caption]] |
| 1959 |
!! html/php |
| 1960 |
<p><a href="/wiki/File:Foobar.jpg" class="image" title="caption"><img alt="caption" src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" decoding="async" width="220" height="25" class="extra thumbborder" 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> |
| 1961 |
</p> |
| 1962 |
!! html/parsoid |
| 1963 |
<p><span class="mw-default-size mw-image-border extra" typeof="mw:File/Frameless" data-mw='{"caption":"caption"}'><a href="./File:Foobar.jpg" class="mw-file-description" title="caption"><img alt="caption" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" decoding="async" 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" class="mw-file-element"/></a></span></p> |
| 1964 |
!! end |
| 1965 |
|
| 1966 |
# Note that 'right' is the default alignment, despite the misspelled 'righ' below |
| 1967 |
!! test |
| 1968 |
Invalid image attributes (T64500) |
| 1969 |
!! options |
| 1970 |
thumbsize=220 |
| 1971 |
parsoid=wt2html,wt2wt,html2html |
| 1972 |
!! config |
| 1973 |
wgParserEnableLegacyMediaDOM=true |
| 1974 |
!! wikitext |
| 1975 |
[[File:Foobar.jpg|thumb|float|left|caption]] |
| 1976 |
|
| 1977 |
[[File:Foobar.jpg|thumb|righ|caption]] |
| 1978 |
|
| 1979 |
[[File:Foobar.jpg|bogus1|thumb|bogus2|left|bogus3|caption]] |
| 1980 |
!! html/php |
| 1981 |
<div class="thumb tleft"><div class="thumbinner" style="width:222px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" decoding="async" width="220" height="25" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>caption</div></div></div> |
| 1982 |
<div class="thumb tright"><div class="thumbinner" style="width:222px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" decoding="async" width="220" height="25" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>caption</div></div></div> |
| 1983 |
<div class="thumb tleft"><div class="thumbinner" style="width:222px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" decoding="async" width="220" height="25" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>caption</div></div></div> |
| 1984 |
!! html/parsoid |
| 1985 |
<figure class="mw-default-size mw-halign-left" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" decoding="async" 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" class="mw-file-element"/></a><figcaption>caption</figcaption></figure> |
| 1986 |
<figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" decoding="async" 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" class="mw-file-element"/></a><figcaption>caption</figcaption></figure> |
| 1987 |
<figure class="mw-default-size mw-halign-left" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" decoding="async" 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" class="mw-file-element"/></a><figcaption>caption</figcaption></figure> |
| 1988 |
!! end |
| 1989 |
|
| 1990 |
!! article |
| 1991 |
File:Barfoo.jpg |
| 1992 |
!! text |
| 1993 |
#REDIRECT [[File:Barfoo.jpg]] |
| 1994 |
!! endarticle |
| 1995 |
|
| 1996 |
# FIXME: Parsoid should run this test -- but we'd need to teach the |
| 1997 |
# mockAPI about the redirected Barfoo.jpg image. |
| 1998 |
!! test |
| 1999 |
Redirected image |
| 2000 |
!! config |
| 2001 |
wgParserEnableLegacyMediaDOM=true |
| 2002 |
!! wikitext |
| 2003 |
[[Image:Barfoo.jpg]] |
| 2004 |
!! html/php |
| 2005 |
<p><a href="/wiki/File:Barfoo.jpg" class="mw-redirect" title="File:Barfoo.jpg">File:Barfoo.jpg</a> |
| 2006 |
</p> |
| 2007 |
!! end |
| 2008 |
|
| 2009 |
## FIXME: Parsoid needs to learn about this flag. |
| 2010 |
!! test |
| 2011 |
Missing image with uploads disabled |
| 2012 |
!! options |
| 2013 |
wgEnableUploads=0 |
| 2014 |
!! config |
| 2015 |
wgParserEnableLegacyMediaDOM=true |
| 2016 |
!! wikitext |
| 2017 |
[[File:Foobaz.jpg]] |
| 2018 |
!! html/php |
| 2019 |
<p><a href="/wiki/File:Foobaz.jpg" title="File:Foobaz.jpg">File:Foobaz.jpg</a> |
| 2020 |
</p> |
| 2021 |
!! html/parsoid |
| 2022 |
<p><span class="mw-default-size" typeof="mw:Error mw:File" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Foobaz.jpg"><span class="mw-file-element mw-broken-media" resource="./File:Foobaz.jpg">File:Foobaz.jpg</span></a></span></p> |
| 2023 |
!! end |
| 2024 |
|
| 2025 |
# Parsoid-specific testing for images |
| 2026 |
# https://www.mediawiki.org/wiki/Specs/HTML#Images |
| 2027 |
# Currently imperfect due to a flaw in the Parsoid testrunner |
| 2028 |
# Work in progress |
| 2029 |
# THESE TESTS SHOULD BE MOVED UP and merged with the php-specific |
| 2030 |
# image tests. |
| 2031 |
|
| 2032 |
!! test |
| 2033 |
Parsoid-specific image handling - simple image with size and middle alignment |
| 2034 |
!! wikitext |
| 2035 |
[[File:Foobar.jpg|middle|50px]] |
| 2036 |
!! html/parsoid |
| 2037 |
<p><span class="mw-valign-middle" typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="6" width="50" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/75px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/100px-Foobar.jpg 2x" class="mw-file-element"/></a></span></p> |
| 2038 |
!! end |
| 2039 |
|
| 2040 |
!! test |
| 2041 |
Parsoid-specific image handling - simple image with size, middle alignment, non-standard namespace alias |
| 2042 |
!! options |
| 2043 |
parsoid=wt2wt,wt2html,html2html |
| 2044 |
!! wikitext |
| 2045 |
[[Image:Foobar.jpg|middle|50px]] |
| 2046 |
!! html/parsoid |
| 2047 |
<p><span class="mw-valign-middle" typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="6" width="50" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/75px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/100px-Foobar.jpg 2x" class="mw-file-element"/></a></span></p> |
| 2048 |
!! end |
| 2049 |
|
| 2050 |
!! test |
| 2051 |
Parsoid-specific image handling - simple image with size and middle alignment (existing content) |
| 2052 |
!! wikitext |
| 2053 |
[[File:Foobar.jpg|50px|middle]] |
| 2054 |
!! html/parsoid |
| 2055 |
<p><span class="mw-valign-middle" typeof="mw:File" data-parsoid='{"optList":[{"ck":"width","ak":"50px"},{"ck":"middle","ak":"middle"}]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="6" width="50" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/75px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/100px-Foobar.jpg 2x" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"6","width":"50"},"sa":{"resource":"File:Foobar.jpg"}}' class="mw-file-element"/></a></span></p> |
| 2056 |
!! end |
| 2057 |
|
| 2058 |
!! test |
| 2059 |
Parsoid-specific image handling - simple image with size and middle alignment and non-standard namespace name |
| 2060 |
!! options |
| 2061 |
parsoid=wt2html,wt2wt,html2html |
| 2062 |
!! wikitext |
| 2063 |
[[Image:Foobar.jpg|50px|middle]] |
| 2064 |
!! html/parsoid |
| 2065 |
<p><span class="mw-valign-middle" typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="6" width="50" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/75px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/100px-Foobar.jpg 2x" class="mw-file-element"/></a></span></p> |
| 2066 |
!! end |
| 2067 |
|
| 2068 |
!! test |
| 2069 |
Parsoid-specific image handling - simple image with both sizes, a baseline alignment, and a caption |
| 2070 |
!! wikitext |
| 2071 |
[[File:Foobar.jpg|500x10px|baseline|caption]] |
| 2072 |
!! html/parsoid |
| 2073 |
<p><span class="mw-valign-baseline" typeof="mw:File" data-mw='{"caption":"caption"}' data-parsoid='{"optList":[{"ck":"width","ak":"500x10px"},{"ck":"baseline","ak":"baseline"},{"ck":"caption","ak":"caption"}],"size":"500x10"}'><a href="./File:Foobar.jpg" class="mw-file-description" title="caption"><img alt="caption" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/89px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="10" width="89" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/133px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/177px-Foobar.jpg 2x" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"10","width":"89"},"sa":{"resource":"File:Foobar.jpg"}}' class="mw-file-element"/></a></span></p> |
| 2074 |
!! end |
| 2075 |
|
| 2076 |
!! test |
| 2077 |
Parsoid-specific image handling - simple image with border and size spec |
| 2078 |
!! wikitext |
| 2079 |
[[File:Foobar.jpg|50px|border|caption]] |
| 2080 |
!! html/parsoid |
| 2081 |
<p><span class="mw-image-border" typeof="mw:File" data-mw='{"caption":"caption"}' data-parsoid='{"optList":[{"ck":"width","ak":"50px"},{"ck":"border","ak":"border"},{"ck":"caption","ak":"caption"}]}'><a href="./File:Foobar.jpg" class="mw-file-description" title="caption"><img alt="caption" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="6" width="50" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/75px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/100px-Foobar.jpg 2x" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"6","width":"50"},"sa":{"resource":"File:Foobar.jpg"}}' class="mw-file-element"/></a></span></p> |
| 2082 |
!! end |
| 2083 |
|
| 2084 |
!! test |
| 2085 |
Parsoid-specific image handling - thumbnail with halign, valign, and caption |
| 2086 |
!! options |
| 2087 |
parsoid=wt2html,html2html |
| 2088 |
!! wikitext |
| 2089 |
[[File:Foobar.jpg|left|baseline|thumb|caption content]] |
| 2090 |
!! html/parsoid |
| 2091 |
<figure class="mw-default-size mw-halign-left" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a><figcaption>caption content</figcaption></figure> |
| 2092 |
!! end |
| 2093 |
|
| 2094 |
!! test |
| 2095 |
Parsoid-specific image handling - thumbnail with halign, valign, and caption (existing content) |
| 2096 |
!! options |
| 2097 |
parsoid=wt2html,html2html |
| 2098 |
!! wikitext |
| 2099 |
[[File:Foobar.jpg|thumb|left|baseline|caption content]] |
| 2100 |
!! html/parsoid |
| 2101 |
<figure class="mw-default-size mw-halign-left" typeof="mw:File/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"left","ak":"left"},{"ck":"baseline","ak":"baseline"},{"ck":"caption","ak":"caption content"}]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a><figcaption>caption content</figcaption></figure> |
| 2102 |
!! end |
| 2103 |
|
| 2104 |
!! test |
| 2105 |
Parsoid-specific image handling - thumbnail with specific size, halign, valign, and caption |
| 2106 |
!! options |
| 2107 |
parsoid=wt2html,html2html |
| 2108 |
!! wikitext |
| 2109 |
[[Image:Foobar.jpg|right|middle|thumb|50x50px|caption]] |
| 2110 |
!! html/parsoid |
| 2111 |
<figure class="mw-halign-right" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="6" width="50" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/75px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/100px-Foobar.jpg 2x" class="mw-file-element"/></a><figcaption>caption</figcaption></figure> |
| 2112 |
!! end |
| 2113 |
|
| 2114 |
!! test |
| 2115 |
Parsoid-specific image handling - thumbnail with specific size, halign, valign, and caption (existing content) |
| 2116 |
!! options |
| 2117 |
parsoid=wt2html,html2html |
| 2118 |
!! wikitext |
| 2119 |
[[File:Foobar.jpg|thumb|50x50px|right|middle|caption]] |
| 2120 |
!! html/parsoid |
| 2121 |
<figure class="mw-halign-right" typeof="mw:File/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"width","ak":"50x50px"},{"ck":"right","ak":"right"},{"ck":"middle","ak":"middle"},{"ck":"caption","ak":"caption"}],"size":"50x50"}'><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="6" width="50" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/75px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/100px-Foobar.jpg 2x" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"6","width":"50"},"sa":{"resource":"File:Foobar.jpg"}}' class="mw-file-element"/></a><figcaption>caption</figcaption></figure> |
| 2122 |
!! end |
| 2123 |
|
| 2124 |
!! test |
| 2125 |
Parsoid-specific image handling - framed image with specific size and caption (size is ignored) |
| 2126 |
!! options |
| 2127 |
parsoid=wt2html,html2html |
| 2128 |
!! wikitext |
| 2129 |
[[File:Foobar.jpg|frame|500x50px|caption]] |
| 2130 |
!! html/parsoid |
| 2131 |
<figure typeof="mw:File/Frame"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a><figcaption>caption</figcaption></figure> |
| 2132 |
!! end |
| 2133 |
|
| 2134 |
!! test |
| 2135 |
Parsoid-specific image handling - framed image with specific size, halign, valign, and caption (size is ignored) |
| 2136 |
!! options |
| 2137 |
parsoid=wt2html,html2html |
| 2138 |
!! wikitext |
| 2139 |
[[File:Foobar.jpg|left|baseline|frame|500x50px|caption]] |
| 2140 |
!! html/parsoid |
| 2141 |
<figure class="mw-halign-left" typeof="mw:File/Frame"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a><figcaption>caption</figcaption></figure> |
| 2142 |
!! end |
| 2143 |
|
| 2144 |
!! test |
| 2145 |
Parsoid-specific image handling - frameless image with specific size, border, and caption |
| 2146 |
!! wikitext |
| 2147 |
[[File:Foobar.jpg|frameless|442x50px|border|caption]] |
| 2148 |
!! html/parsoid |
| 2149 |
<p><span class="mw-image-border" typeof="mw:File/Frameless" data-mw='{"caption":"caption"}' data-parsoid='{"optList":[{"ck":"frameless","ak":"frameless"},{"ck":"width","ak":"442x50px"},{"ck":"border","ak":"border"},{"ck":"caption","ak":"caption"}],"size":"442x50"}'><a href="./File:Foobar.jpg" class="mw-file-description" title="caption"><img alt="caption" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/442px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="50" width="442" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/662px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/883px-Foobar.jpg 2x" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"50","width":"442"},"sa":{"resource":"File:Foobar.jpg"}}' class="mw-file-element"/></a></span></p> |
| 2150 |
!! end |
| 2151 |
|
| 2152 |
!! test |
| 2153 |
Parsoid-specific image handling - simple image with a formatted caption |
| 2154 |
!! wikitext |
| 2155 |
[[File:Foobar.jpg|<table><tr><td>a</td><td>b</td></tr><tr><td>c</td></tr></table>]] |
| 2156 |
!! html/parsoid |
| 2157 |
<p><span class="mw-default-size" typeof="mw:File" data-parsoid='{"optList":[{"ck":"caption","ak":"<table><tr><td>a</td><td>b</td></tr><tr><td>c</td></tr></table>"}]}' data-mw='{"caption":"<table data-parsoid='{\"stx\":\"html\",\"dsr\":[18,81,7,8]}'><tbody data-parsoid='{\"dsr\":[25,73,0,0]}'><tr data-parsoid='{\"stx\":\"html\",\"dsr\":[25,54,4,5]}'><td data-parsoid='{\"stx\":\"html\",\"dsr\":[29,39,4,5]}'>a</td><td data-parsoid='{\"stx\":\"html\",\"dsr\":[39,49,4,5]}'>b</td></tr><tr data-parsoid='{\"stx\":\"html\",\"dsr\":[54,73,4,5]}'><td data-parsoid='{\"stx\":\"html\",\"dsr\":[58,68,4,5]}'>c</td></tr></tbody></table>"}'><a href="./File:Foobar.jpg" class="mw-file-description" title="abc"><img alt="abc" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"220","width":"1941"},"sa":{"resource":"File:Foobar.jpg"}}' class="mw-file-element"/></a></span></p> |
| 2158 |
!! end |
| 2159 |
|
| 2160 |
!! test |
| 2161 |
Parsoid-specific image handling - caption with a template in it |
| 2162 |
!! wikitext |
| 2163 |
[[File:Foobar.jpg|thumb|200x23px|This caption has a {{1x|transclusion}} in it.]] |
| 2164 |
!! html/parsoid |
| 2165 |
<figure typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="23" width="200" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/400px-Foobar.jpg 2x" class="mw-file-element"/></a><figcaption>This caption has a <span about="#mwt1" typeof="mw:Transclusion" data-mw="{"parts":[{"template":{"target":{"wt":"1x","href":"./Template:1x"},"params":{"1":{"wt":"transclusion"}},"i":0}}]}">transclusion</span> in it.</figcaption></figure> |
| 2166 |
!! end |
| 2167 |
|
| 2168 |
!! test |
| 2169 |
Parsoid-specific image handling - caption with unbalanced tags in it |
| 2170 |
!! options |
| 2171 |
parsoid=wt2html,wt2wt,html2html |
| 2172 |
!! wikitext |
| 2173 |
foo |
| 2174 |
[[File:Foobar.jpg|thumb|200x200px|This caption has a <center>unbalanced tag in it.]] |
| 2175 |
bar |
| 2176 |
!! html/parsoid |
| 2177 |
<p>foo</p> |
| 2178 |
<figure typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="23" width="200" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/400px-Foobar.jpg 2x" class="mw-file-element"/></a><figcaption>This caption has a <center>unbalanced tag in it.</center></figcaption></figure> |
| 2179 |
<p>bar</p> |
| 2180 |
!! end |
| 2181 |
|
| 2182 |
!! test |
| 2183 |
Parsoid-specific image handling - empty caption (1) |
| 2184 |
!! options |
| 2185 |
parsoid=wt2html,wt2wt |
| 2186 |
!! wikitext |
| 2187 |
[[File:Foobar.jpg|thumb|]] |
| 2188 |
!! html/parsoid |
| 2189 |
<figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a><figcaption></figcaption></figure> |
| 2190 |
!! end |
| 2191 |
|
| 2192 |
# empty captions don't get serialized unless we're in the "round trip" case |
| 2193 |
!! test |
| 2194 |
Parsoid-specific image handling - empty caption (2) |
| 2195 |
!! options |
| 2196 |
parsoid=html2wt |
| 2197 |
!! html/parsoid |
| 2198 |
<figure class="mw-default-size" typeof="mw:File/Thumb"> |
| 2199 |
<a href="./File:Foobar.jpg"> |
| 2200 |
<img resource="./File:Foobar.jpg" |
| 2201 |
src="http://example.com/images/3/3a/Foobar.jpg" |
| 2202 |
decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" |
| 2203 |
height="25" width="220"/> |
| 2204 |
</a> |
| 2205 |
<figcaption></figcaption> |
| 2206 |
</figure> |
| 2207 |
!! wikitext |
| 2208 |
[[File:Foobar.jpg|thumb]] |
| 2209 |
!! end |
| 2210 |
|
| 2211 |
!! test |
| 2212 |
Parsoid-specific image handling - whitespace caption |
| 2213 |
!! wikitext |
| 2214 |
[[File:Foobar.jpg|thumb| ]] |
| 2215 |
!! html/parsoid |
| 2216 |
<figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a><figcaption> </figcaption></figure> |
| 2217 |
!! end |
| 2218 |
|
| 2219 |
!! test |
| 2220 |
Parsoid-specific image handling - lang option |
| 2221 |
!! wikitext |
| 2222 |
foo |
| 2223 |
[[File:Foobar.svg|lang=de|caption]] |
| 2224 |
bar |
| 2225 |
!! html/parsoid |
| 2226 |
<p>foo |
| 2227 |
<span class="mw-default-size" typeof="mw:File" data-mw='{"caption":"caption"}'><a href="./File:Foobar.svg?lang=de" class="mw-file-description" title="caption"><img alt="caption" resource="./File:Foobar.svg" src="http://example.com/images/thumb/f/ff/Foobar.svg/langde-240px-Foobar.svg.png" decoding="async" lang="de" data-file-width="240" data-file-height="180" data-file-type="drawing" height="180" width="240" srcset="http://example.com/images/thumb/f/ff/Foobar.svg/langde-360px-Foobar.svg.png 1.5x, http://example.com/images/thumb/f/ff/Foobar.svg/langde-480px-Foobar.svg.png 2x" data-parsoid='{"a":{"resource":"./File:Foobar.svg","lang":"de","height":"180","width":"240"},"sa":{"resource":"File:Foobar.svg","lang":"lang=de"}}' class="mw-file-element"/></a></span> |
| 2228 |
bar</p> |
| 2229 |
!! end |
| 2230 |
|
| 2231 |
!! test |
| 2232 |
File containing double quotes and spaces |
| 2233 |
!! config |
| 2234 |
wgParserEnableLegacyMediaDOM=true |
| 2235 |
!! wikitext |
| 2236 |
[[File:Cool "Gator".png]] |
| 2237 |
!! html/php |
| 2238 |
<p><a href="/index.php?title=Special:Upload&wpDestFile=Cool_%22Gator%22.png" class="new" title="File:Cool "Gator".png">File:Cool "Gator".png</a> |
| 2239 |
</p> |
| 2240 |
!! html/parsoid |
| 2241 |
<p><span class="mw-default-size" typeof="mw:Error mw:File" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Cool_%22Gator%22.png"><span class="mw-file-element mw-broken-media" resource='./File:Cool_"Gator".png' data-parsoid='{"a":{"resource":"./File:Cool_\"Gator\".png"},"sa":{"resource":"File:Cool \"Gator\".png"}}'>File:Cool "Gator".png</span></a></span></p> |
| 2242 |
!! end |
| 2243 |
|
| 2244 |
!! test |
| 2245 |
File containing single quotes |
| 2246 |
!! config |
| 2247 |
wgParserEnableLegacyMediaDOM=true |
| 2248 |
!! wikitext |
| 2249 |
[[File:Foo's ''italic'' bar.jpg]] |
| 2250 |
[[File:Foo's ''italic'' bar.jpg|Foo's ''italic'' bar]] |
| 2251 |
!! html/php |
| 2252 |
<p><a href="/index.php?title=Special:Upload&wpDestFile=Foo%27s_%27%27italic%27%27_bar.jpg" class="new" title="File:Foo's ''italic'' bar.jpg">File:Foo's <i>italic</i> bar.jpg</a> |
| 2253 |
<a href="/index.php?title=Special:Upload&wpDestFile=Foo%27s_%27%27italic%27%27_bar.jpg" class="new" title="File:Foo's ''italic'' bar.jpg">Foo's italic bar</a> |
| 2254 |
</p> |
| 2255 |
!! end |
| 2256 |
|
| 2257 |
!! test |
| 2258 |
Broken image links with HTML captions (T41700) |
| 2259 |
!! config |
| 2260 |
wgParserEnableLegacyMediaDOM=true |
| 2261 |
!! wikitext |
| 2262 |
[[File:Nonexistent|<script></script>]] |
| 2263 |
[[File:Nonexistent|100x100px|<script></script>]] |
| 2264 |
[[File:Nonexistent|<]] |
| 2265 |
[[File:Nonexistent|a<i>b</i>c]] |
| 2266 |
!! html/php |
| 2267 |
<p><a href="/index.php?title=Special:Upload&wpDestFile=Nonexistent" class="new" title="File:Nonexistent"><script></script></a> |
| 2268 |
<a href="/index.php?title=Special:Upload&wpDestFile=Nonexistent" class="new" title="File:Nonexistent"><script></script></a> |
| 2269 |
<a href="/index.php?title=Special:Upload&wpDestFile=Nonexistent" class="new" title="File:Nonexistent"><</a> |
| 2270 |
<a href="/index.php?title=Special:Upload&wpDestFile=Nonexistent" class="new" title="File:Nonexistent">abc</a> |
| 2271 |
</p> |
| 2272 |
!! html/parsoid |
| 2273 |
<p><span class="mw-default-size" typeof="mw:Error mw:File" data-parsoid='{"optList":[{"ck":"caption","ak":"<script></script>"}]}' data-mw='{"caption":"&lt;script>&lt;/script>","errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Nonexistent"><span class="mw-file-element mw-broken-media" resource="./File:Nonexistent" data-parsoid='{"a":{"resource":"./File:Nonexistent"},"sa":{"resource":"File:Nonexistent"}}'><script></script></span></a></span> |
| 2274 |
<span typeof="mw:Error mw:File" data-parsoid='{"optList":[{"ck":"width","ak":"100x100px"},{"ck":"caption","ak":"<script></script>"}]}' data-mw='{"caption":"&lt;script>&lt;/script>","errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Nonexistent"><span class="mw-file-element mw-broken-media" resource="./File:Nonexistent" data-width="100" data-height="100" data-parsoid='{"a":{"resource":"./File:Nonexistent"},"sa":{"resource":"File:Nonexistent"}}'><script></script></span></a></span> |
| 2275 |
<span class="mw-default-size" typeof="mw:Error mw:File" data-parsoid='{"optList":[{"ck":"caption","ak":"&lt;"}]}' data-mw='{"caption":"<span typeof=\"mw:Entity\" data-parsoid='{\"src\":\"&amp;lt;\",\"srcContent\":\"&lt;\",\"dsr\":[107,111,null,null]}'>&lt;</span>","errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Nonexistent"><span class="mw-file-element mw-broken-media" resource="./File:Nonexistent" data-parsoid='{"a":{"resource":"./File:Nonexistent"},"sa":{"resource":"File:Nonexistent"}}'><</span></a></span> |
| 2276 |
<span class="mw-default-size" typeof="mw:Error mw:File" data-parsoid='{"optList":[{"ck":"caption","ak":"a<i>b</i>c"}]}' data-mw='{"caption":"a<i data-parsoid='{\"stx\":\"html\",\"dsr\":[134,142,3,4]}'>b</i>c","errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Nonexistent"><span class="mw-file-element mw-broken-media" resource="./File:Nonexistent" data-parsoid='{"a":{"resource":"./File:Nonexistent"},"sa":{"resource":"File:Nonexistent"}}'>abc</span></a></span></p> |
| 2277 |
!! end |
| 2278 |
|
| 2279 |
!! test |
| 2280 |
Media in wikilink |
| 2281 |
!! config |
| 2282 |
wgParserEnableLegacyMediaDOM=true |
| 2283 |
!! wikitext |
| 2284 |
[[Test|[[File:Foobar.jpg]]]] |
| 2285 |
!! html/php |
| 2286 |
<p>[[Test|<a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a>]] |
| 2287 |
</p> |
| 2288 |
!! html/parsoid |
| 2289 |
<p>[[Test|<span class="mw-default-size" typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"220","width":"1941"},"sa":{"resource":"File:Foobar.jpg"}}' class="mw-file-element"/></a></span>]]</p> |
| 2290 |
!! end |
| 2291 |
|
| 2292 |
!! article |
| 2293 |
No link |
| 2294 |
!! text |
| 2295 |
Dummy article to suppress redlinks in tests |
| 2296 |
!! end |
| 2297 |
|
| 2298 |
!! test |
| 2299 |
Template with thumb image (with link in description) |
| 2300 |
!! config |
| 2301 |
wgParserEnableLegacyMediaDOM=true |
| 2302 |
!! wikitext |
| 2303 |
{{paramtest|param=[[Image:noimage.png|thumb|[[no link|link]] [[no link|caption]]]]}} |
| 2304 |
!! html/php |
| 2305 |
<p>This is a test template with parameter </p><div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/index.php?title=Special:Upload&wpDestFile=Noimage.png" class="new" title="File:Noimage.png">File:Noimage.png</a> <div class="thumbcaption"><a href="/wiki/No_link" title="No link">link</a> <a href="/wiki/No_link" title="No link">caption</a></div></div></div> |
| 2306 |
!! html/parsoid |
| 2307 |
<p about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"pi":[[{"k":"param","named":true}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"paramtest","href":"./Template:Paramtest"},"params":{"param":{"wt":"[[Image:noimage.png|thumb|[[no link|link]] [[no link|caption]]]]"}},"i":0}}]}'>This is a test template with parameter </p><figure class="mw-default-size" typeof="mw:Error mw:File/Thumb" about="#mwt1" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Noimage.png"><span class="mw-file-element mw-broken-media" resource="./File:Noimage.png" data-width="180">File:Noimage.png</span></a><figcaption><a rel="mw:WikiLink" href="./No_link" title="No link">link</a> <a rel="mw:WikiLink" href="./No_link" title="No link">caption</a></figcaption></figure> |
| 2308 |
!! end |
| 2309 |
|
| 2310 |
!! test |
| 2311 |
T3219 URL next to image (good) |
| 2312 |
!! config |
| 2313 |
wgParserEnableLegacyMediaDOM=true |
| 2314 |
!! wikitext |
| 2315 |
http://example.com [[File:Foobar.jpg]] |
| 2316 |
!! html/php |
| 2317 |
<p><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a> <a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 2318 |
</p> |
| 2319 |
!! html/parsoid |
| 2320 |
<p><a rel="mw:ExtLink" href="http://example.com" class="external free">http://example.com</a> <span class="mw-default-size" typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a></span></p> |
| 2321 |
!!end |
| 2322 |
|
| 2323 |
!! test |
| 2324 |
T3219 URL next to image (broken) |
| 2325 |
!! config |
| 2326 |
wgParserEnableLegacyMediaDOM=true |
| 2327 |
!! wikitext |
| 2328 |
http://example.com[[File:Foobar.jpg]] |
| 2329 |
!! html/php |
| 2330 |
<p><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 2331 |
</p> |
| 2332 |
!! html/parsoid |
| 2333 |
<p><a rel="mw:ExtLink" href="http://example.com" class="external free">http://example.com</a><span class="mw-default-size" typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a></span></p> |
| 2334 |
!!end |
| 2335 |
|
| 2336 |
!! test |
| 2337 |
Image link to nonexistent file (T3850 - good) |
| 2338 |
!! config |
| 2339 |
wgParserEnableLegacyMediaDOM=true |
| 2340 |
!! wikitext |
| 2341 |
[[File:No_such.jpg]] |
| 2342 |
!! html/php |
| 2343 |
<p><a href="/index.php?title=Special:Upload&wpDestFile=No_such.jpg" class="new" title="File:No such.jpg">File:No such.jpg</a> |
| 2344 |
</p> |
| 2345 |
!! html/parsoid |
| 2346 |
<p><span class="mw-default-size" typeof="mw:Error mw:File" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/No_such.jpg"><span class="mw-file-element mw-broken-media" resource="./File:No_such.jpg">File:No such.jpg</span></a></span></p> |
| 2347 |
!! end |
| 2348 |
|
| 2349 |
!! test |
| 2350 |
:Image link to nonexistent file (T3850 - bad) |
| 2351 |
!! config |
| 2352 |
wgParserEnableLegacyMediaDOM=true |
| 2353 |
!! wikitext |
| 2354 |
[[:Image:No such.jpg]] |
| 2355 |
!! html/php |
| 2356 |
<p><a href="/index.php?title=File:No_such.jpg&action=edit&redlink=1" class="new" title="File:No such.jpg (page does not exist)">Image:No such.jpg</a> |
| 2357 |
</p> |
| 2358 |
!! html/parsoid |
| 2359 |
<p><a rel="mw:WikiLink" href="./File:No_such.jpg?action=edit&redlink=1" title="File:No such.jpg" class="new" typeof="mw:LocalizedAttrs" data-parsoid='{"stx":"simple","a":{"href":"./File:No_such.jpg"},"sa":{"href":":Image:No such.jpg"}}' data-mw-i18n='{"title":{"lang":"x-page","key":"red-link-title","params":["File:No such.jpg"]}}'>Image:No such.jpg</a></p> |
| 2360 |
!! end |
| 2361 |
|
| 2362 |
!! test |
| 2363 |
Fuzz testing: image with bogus manual thumbnail |
| 2364 |
!! config |
| 2365 |
wgParserEnableLegacyMediaDOM=true |
| 2366 |
!! wikitext |
| 2367 |
[[Image:foobar.jpg|thumbnail= ]] |
| 2368 |
!! html/php |
| 2369 |
<div class="thumb tright"><div class="thumbinner" style="width:182px;">Error creating thumbnail: <div class="thumbcaption"></div></div></div> |
| 2370 |
!! html/parsoid |
| 2371 |
<figure typeof="mw:Error mw:File/Thumb" data-parsoid='{"optList":[{"ck":"manualthumb","ak":"thumbnail= "}]}' data-mw='{"attribs":[["manualthumb",{"txt":""}]],"errors":[{"key":"apierror-invalidtitle","message":"Invalid thumbnail title.","params":{"name":""}}]}'><a href="./Special:FilePath/Foobar.jpg"><span class="mw-file-element mw-broken-media" resource="./File:Foobar.jpg" data-parsoid='{"a":{"resource":"./File:Foobar.jpg"},"sa":{"resource":"Image:foobar.jpg"}}'>File:Foobar.jpg</span></a><figcaption></figcaption></figure> |
| 2372 |
!! end |
| 2373 |
|
| 2374 |
!! test |
| 2375 |
Gallery with valid attributes |
| 2376 |
!! config |
| 2377 |
wgParserEnableLegacyMediaDOM=true |
| 2378 |
!! wikitext |
| 2379 |
<gallery type="123" summary="345"> |
| 2380 |
File:File:Foobar.jpg |
| 2381 |
</gallery> |
| 2382 |
!! html/php |
| 2383 |
<ul class="gallery mw-gallery-traditional" type="123"> |
| 2384 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 2385 |
<div class="thumb" style="height: 150px;">File:Foobar.jpg</div> |
| 2386 |
<div class="gallerytext"></div> |
| 2387 |
</div></li> |
| 2388 |
</ul> |
| 2389 |
!! html/parsoid |
| 2390 |
<ul class="gallery mw-gallery-traditional" type="123" typeof="mw:Extension/gallery" about="#mwt3" data-mw='{"name":"gallery","attrs":{"type":"123","summary":"345"},"body":{}}'> |
| 2391 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="height: 150px;"><span typeof="mw:Error mw:File" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/File:Foobar.jpg"><span class="mw-file-element mw-broken-media" resource="./File:File:Foobar.jpg" data-width="120" data-height="120">File:File:Foobar.jpg</span></a></span></div><div class="gallerytext"></div></li> |
| 2392 |
</ul> |
| 2393 |
!! end |
| 2394 |
|
| 2395 |
## Parsoid thinks the "centre" here is a property, not a caption. |
| 2396 |
!! test |
| 2397 |
Gallery |
| 2398 |
!! options |
| 2399 |
parsoid={ |
| 2400 |
"modes": ["wt2html"] |
| 2401 |
} |
| 2402 |
!! config |
| 2403 |
wgParserEnableLegacyMediaDOM=true |
| 2404 |
!! wikitext |
| 2405 |
<gallery> |
| 2406 |
image1.png | |
| 2407 |
image2.gif||||| |
| 2408 |
|
| 2409 |
image3| |
| 2410 |
image4 |300px| centre |
| 2411 |
image5.svg| http:///////// |
| 2412 |
[[x|xx]]]] |
| 2413 |
* image6 |
| 2414 |
</gallery> |
| 2415 |
!! html/php |
| 2416 |
<ul class="gallery mw-gallery-traditional"> |
| 2417 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 2418 |
<div class="thumb" style="height: 150px;">Image1.png</div> |
| 2419 |
<div class="gallerytext"></div> |
| 2420 |
</div></li> |
| 2421 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 2422 |
<div class="thumb" style="height: 150px;">Image2.gif</div> |
| 2423 |
<div class="gallerytext"></div> |
| 2424 |
</div></li> |
| 2425 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 2426 |
<div class="thumb" style="height: 150px;">Image3</div> |
| 2427 |
<div class="gallerytext"></div> |
| 2428 |
</div></li> |
| 2429 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 2430 |
<div class="thumb" style="height: 150px;">Image4</div> |
| 2431 |
<div class="gallerytext"> centre</div> |
| 2432 |
</div></li> |
| 2433 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 2434 |
<div class="thumb" style="height: 150px;">Image5.svg</div> |
| 2435 |
<div class="gallerytext"> <a rel="nofollow" class="external free" href="http://///////">http://///////</a></div> |
| 2436 |
</div></li> |
| 2437 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 2438 |
<div class="thumb" style="height: 150px;">* image6</div> |
| 2439 |
<div class="gallerytext"></div> |
| 2440 |
</div></li> |
| 2441 |
</ul> |
| 2442 |
!! html/parsoid |
| 2443 |
<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt3" data-mw='{"name":"gallery","attrs":{},"body":{}}'> |
| 2444 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="height: 150px;"><span typeof="mw:Error mw:File" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Image1.png"><span class="mw-file-element mw-broken-media" resource="./File:Image1.png" data-width="120" data-height="120">File:Image1.png</span></a></span></div><div class="gallerytext"></div></li> |
| 2445 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="height: 150px;"><span typeof="mw:Error mw:File" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Image2.gif"><span class="mw-file-element mw-broken-media" resource="./File:Image2.gif" data-width="120" data-height="120">File:Image2.gif</span></a></span></div><div class="gallerytext"></div></li> |
| 2446 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="height: 150px;"><span typeof="mw:Error mw:File" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Image3"><span class="mw-file-element mw-broken-media" resource="./File:Image3" data-width="120" data-height="120">File:Image3</span></a></span></div><div class="gallerytext"></div></li> |
| 2447 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="height: 150px;"><span typeof="mw:Error mw:File" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Image4"><span class="mw-file-element mw-broken-media" resource="./File:Image4" data-width="120" data-height="120">File:Image4</span></a></span></div><div class="gallerytext"></div></li> |
| 2448 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="height: 150px;"><span typeof="mw:Error mw:File" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Image5.svg"><span class="mw-file-element mw-broken-media" resource="./File:Image5.svg" data-width="120" data-height="120">http://///////</span></a></span></div><div class="gallerytext"> <a rel="mw:ExtLink" href="http://///////" class="external free">http://///////</a></div></li> |
| 2449 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="height: 150px;"><span typeof="mw:Error mw:File" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/*_image6"><span class="mw-file-element mw-broken-media" resource="./File:*_image6" data-width="120" data-height="120">File:* image6</span></a></span></div><div class="gallerytext"></div></li> |
| 2450 |
</ul> |
| 2451 |
!! end |
| 2452 |
|
| 2453 |
!! test |
| 2454 |
Gallery (with options, html) |
| 2455 |
!! config |
| 2456 |
wgParserEnableLegacyMediaDOM=true |
| 2457 |
!! wikitext |
| 2458 |
<gallery widths="70px" heights="40px" perrow="2" caption="Foo [[Main Page]]"> |
| 2459 |
File:Nonexistent.jpg|caption |
| 2460 |
File:Nonexistent.jpg |
| 2461 |
image:foobar.jpg|some '''caption''' [[Main Page]] |
| 2462 |
image:foobar.jpg |
| 2463 |
image:foobar.jpg|alt=This is a foo-bar.|blabla. |
| 2464 |
</gallery> |
| 2465 |
!! html/php |
| 2466 |
<ul class="gallery mw-gallery-traditional" style="max-width: 226px;"> |
| 2467 |
<li class="gallerycaption">Foo <a href="/wiki/Main_Page" title="Main Page">Main Page</a></li> |
| 2468 |
<li class="gallerybox" style="width: 105px"><div style="width: 105px"> |
| 2469 |
<div class="thumb" style="height: 70px;">Nonexistent.jpg</div> |
| 2470 |
<div class="gallerytext">caption</div> |
| 2471 |
</div></li> |
| 2472 |
<li class="gallerybox" style="width: 105px"><div style="width: 105px"> |
| 2473 |
<div class="thumb" style="height: 70px;">Nonexistent.jpg</div> |
| 2474 |
<div class="gallerytext"></div> |
| 2475 |
</div></li> |
| 2476 |
<li class="gallerybox" style="width: 105px"><div style="width: 105px"> |
| 2477 |
<div class="thumb" style="width: 100px;"><div style="margin:31px auto;"><a href="/wiki/File:Foobar.jpg" class="image" title="some caption Main Page"><img alt="some caption Main Page" src="http://example.com/images/thumb/3/3a/Foobar.jpg/70px-Foobar.jpg" decoding="async" width="70" height="8" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/105px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/140px-Foobar.jpg 2x" /></a></div></div> |
| 2478 |
<div class="gallerytext">some <b>caption</b> <a href="/wiki/Main_Page" title="Main Page">Main Page</a></div> |
| 2479 |
</div></li> |
| 2480 |
<li class="gallerybox" style="width: 105px"><div style="width: 105px"> |
| 2481 |
<div class="thumb" style="width: 100px;"><div style="margin:31px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/70px-Foobar.jpg" decoding="async" width="70" height="8" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/105px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/140px-Foobar.jpg 2x" /></a></div></div> |
| 2482 |
<div class="gallerytext"></div> |
| 2483 |
</div></li> |
| 2484 |
<li class="gallerybox" style="width: 105px"><div style="width: 105px"> |
| 2485 |
<div class="thumb" style="width: 100px;"><div style="margin:31px auto;"><a href="/wiki/File:Foobar.jpg" class="image" title="blabla."><img alt="This is a foo-bar." src="http://example.com/images/thumb/3/3a/Foobar.jpg/70px-Foobar.jpg" decoding="async" width="70" height="8" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/105px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/140px-Foobar.jpg 2x" /></a></div></div> |
| 2486 |
<div class="gallerytext">blabla.</div> |
| 2487 |
</div></li> |
| 2488 |
</ul> |
| 2489 |
!! html/parsoid |
| 2490 |
<ul class="gallery mw-gallery-traditional" style="max-width: 226px;" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","attrs":{"widths":"70px","heights":"40px","perrow":"2"},"body":{}}'> |
| 2491 |
<li class="gallerycaption">Foo <a rel="mw:WikiLink" href="./Main_Page" title="Main Page">Main Page</a></li> |
| 2492 |
<li class="gallerybox" style="width: 105px;"><div class="thumb" style="height: 70px;"><span typeof="mw:Error mw:File" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Nonexistent.jpg"><span class="mw-file-element mw-broken-media" resource="./File:Nonexistent.jpg" data-width="70" data-height="40">caption</span></a></span></div><div class="gallerytext">caption</div></li> |
| 2493 |
<li class="gallerybox" style="width: 105px;"><div class="thumb" style="height: 70px;"><span typeof="mw:Error mw:File" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Nonexistent.jpg"><span class="mw-file-element mw-broken-media" resource="./File:Nonexistent.jpg" data-width="70" data-height="40">File:Nonexistent.jpg</span></a></span></div><div class="gallerytext"></div></li> |
| 2494 |
<li class="gallerybox" style="width: 105px;"><div class="thumb" style="width: 100px; height: 70px;"><span typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description" title="some caption Main Page"><img alt="some caption Main Page" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/70px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="8" width="70" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/105px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/140px-Foobar.jpg 2x" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"8","width":"70"},"sa":{"resource":"image:foobar.jpg"}}' class="mw-file-element"/></a></span></div><div class="gallerytext">some <b>caption</b> <a rel="mw:WikiLink" href="./Main_Page" title="Main Page">Main Page</a></div></li> |
| 2495 |
<li class="gallerybox" style="width: 105px;"><div class="thumb" style="width: 100px; height: 70px;"><span typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/70px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="8" width="70" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/105px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/140px-Foobar.jpg 2x" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"8","width":"70"},"sa":{"resource":"image:foobar.jpg"}}' class="mw-file-element"/></a></span></div><div class="gallerytext"></div></li> |
| 2496 |
<li class="gallerybox" style="width: 105px;"><div class="thumb" style="width: 100px; height: 70px;"><span typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description" title="blabla."><img alt="This is a foo-bar." resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/70px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="8" width="70" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/105px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/140px-Foobar.jpg 2x" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"8","width":"70"},"sa":{"resource":"image:foobar.jpg"}}' class="mw-file-element"/></a></span></div><div class="gallerytext">blabla.</div></li> |
| 2497 |
</ul> |
| 2498 |
!! end |
| 2499 |
|
| 2500 |
!! test |
| 2501 |
Gallery (without px units) |
| 2502 |
!! config |
| 2503 |
wgParserEnableLegacyMediaDOM=true |
| 2504 |
!! wikitext |
| 2505 |
<gallery widths="70" heights="40"> |
| 2506 |
File:Foobar.jpg |
| 2507 |
</gallery> |
| 2508 |
!! html/php |
| 2509 |
<ul class="gallery mw-gallery-traditional"> |
| 2510 |
<li class="gallerybox" style="width: 105px"><div style="width: 105px"> |
| 2511 |
<div class="thumb" style="width: 100px;"><div style="margin:31px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/70px-Foobar.jpg" decoding="async" width="70" height="8" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/105px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/140px-Foobar.jpg 2x" /></a></div></div> |
| 2512 |
<div class="gallerytext"></div> |
| 2513 |
</div></li> |
| 2514 |
</ul> |
| 2515 |
!! html/parsoid |
| 2516 |
<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","attrs":{"widths":"70","heights":"40"},"body":{}}'> |
| 2517 |
<li class="gallerybox" style="width: 105px;"><div class="thumb" style="width: 100px; height: 70px;"><span typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/70px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="8" width="70" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/105px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/140px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div><div class="gallerytext"></div></li> |
| 2518 |
</ul> |
| 2519 |
!! end |
| 2520 |
|
| 2521 |
!! test |
| 2522 |
Gallery (with invalid units) |
| 2523 |
!! config |
| 2524 |
wgParserEnableLegacyMediaDOM=true |
| 2525 |
!! wikitext |
| 2526 |
<gallery widths="70em" heights="40em"> |
| 2527 |
File:Foobar.jpg |
| 2528 |
</gallery> |
| 2529 |
!! html/php |
| 2530 |
<ul class="gallery mw-gallery-traditional"> |
| 2531 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 2532 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 2533 |
<div class="gallerytext"></div> |
| 2534 |
</div></li> |
| 2535 |
</ul> |
| 2536 |
!! html/parsoid |
| 2537 |
<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","attrs":{"widths":"70em","heights":"40em"},"body":{}}'> |
| 2538 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div><div class="gallerytext"></div></li> |
| 2539 |
</ul> |
| 2540 |
!! end |
| 2541 |
|
| 2542 |
!! test |
| 2543 |
Gallery with link that has fragment |
| 2544 |
!! options |
| 2545 |
parsoid={ |
| 2546 |
"modes": ["wt2html", "html2html"] |
| 2547 |
} |
| 2548 |
!! config |
| 2549 |
wgParserEnableLegacyMediaDOM=true |
| 2550 |
!! wikitext |
| 2551 |
<gallery> |
| 2552 |
image:foobar.jpg|link=Main_Page |
| 2553 |
image:foobar.jpg|link=Main_Page#section |
| 2554 |
image:foobar.jpg|link=Main Page#section|caption |
| 2555 |
</gallery> |
| 2556 |
!! html/php |
| 2557 |
<ul class="gallery mw-gallery-traditional"> |
| 2558 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 2559 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/Main_Page" title="Main Page"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 2560 |
<div class="gallerytext"></div> |
| 2561 |
</div></li> |
| 2562 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 2563 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/Main_Page#section" title="Main Page"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 2564 |
<div class="gallerytext"></div> |
| 2565 |
</div></li> |
| 2566 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 2567 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/Main_Page#section" title="caption"><img alt="caption" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 2568 |
<div class="gallerytext">caption</div> |
| 2569 |
</div></li> |
| 2570 |
</ul> |
| 2571 |
!! html/parsoid |
| 2572 |
<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","attrs":{},"body":{}}'> |
| 2573 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File"><a href="./Main_Page" title="Main Page"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div><div class="gallerytext"></div></li> |
| 2574 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File"><a href="./Main_Page#section" title="Main Page"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div><div class="gallerytext"></div></li> |
| 2575 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File"><a href="./Main_Page#section" title="caption"><img alt="caption" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div><div class="gallerytext">caption</div></li> |
| 2576 |
</ul> |
| 2577 |
!! end |
| 2578 |
|
| 2579 |
!! test |
| 2580 |
Gallery with template inside caption |
| 2581 |
!! config |
| 2582 |
wgParserEnableLegacyMediaDOM=true |
| 2583 |
!! wikitext |
| 2584 |
<gallery caption="{{1x|hi}}"> |
| 2585 |
File:Foobar.jpg|{{1x|ho}} |
| 2586 |
</gallery> |
| 2587 |
!! html/php |
| 2588 |
<ul class="gallery mw-gallery-traditional"> |
| 2589 |
<li class="gallerycaption">hi</li> |
| 2590 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 2591 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image" title="ho"><img alt="ho" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 2592 |
<div class="gallerytext">ho</div> |
| 2593 |
</div></li> |
| 2594 |
</ul> |
| 2595 |
!! html/parsoid |
| 2596 |
<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt6" data-mw='{"name":"gallery","attrs":{},"body":{}}'> |
| 2597 |
<li class="gallerycaption"><span about="#mwt3" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"1x","href":"./Template:1x"},"params":{"1":{"wt":"hi"}},"i":0}}]}'>hi</span></li> |
| 2598 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description" title="ho"><img alt="ho" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div><div class="gallerytext"><span about="#mwt5" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"1x","href":"./Template:1x"},"params":{"1":{"wt":"ho"}},"i":0}}]}'>ho</span></div></li> |
| 2599 |
</ul> |
| 2600 |
!! end |
| 2601 |
|
| 2602 |
!! article |
| 2603 |
Link |
| 2604 |
!! text |
| 2605 |
Dummy article to suppress redlinks in tests |
| 2606 |
!! end |
| 2607 |
|
| 2608 |
# Ugh! The +standalone/+integrated repetition is because of the {{ns:-1}} wikitext that |
| 2609 |
# renders as "-1" in standalone mode and "Special" in integrated mode. |
| 2610 |
!! test |
| 2611 |
Gallery with wikitext inside gallery caption |
| 2612 |
!! options |
| 2613 |
parsoid={ |
| 2614 |
"modes": ["wt2html", "html2html"] |
| 2615 |
} |
| 2616 |
!! config |
| 2617 |
wgParserEnableLegacyMediaDOM=true |
| 2618 |
!! wikitext |
| 2619 |
<gallery caption="# This should not be a list item |
| 2620 |
|
| 2621 |
Text '''bold''' [[link]] {{ns:-1}} |
| 2622 |
|
| 2623 |
[[File:Foobar.jpg|thumb|File in gallery caption]]"> |
| 2624 |
File:Foobar.jpg|Image caption |
| 2625 |
</gallery> |
| 2626 |
!! html/php |
| 2627 |
<ul class="gallery mw-gallery-traditional"> |
| 2628 |
<li class="gallerycaption"># This should not be a list item Text <b>bold</b> <a href="/wiki/Link" title="Link">link</a> Special <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>File in gallery caption</div></div></div></li> |
| 2629 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 2630 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image" title="Image caption"><img alt="Image caption" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 2631 |
<div class="gallerytext">Image caption</div> |
| 2632 |
</div></li> |
| 2633 |
</ul> |
| 2634 |
!! html/parsoid+standalone |
| 2635 |
<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt4" data-mw='{"name":"gallery","attrs":{},"body":{}}'> |
| 2636 |
<li class="gallerycaption"># This should not be a list item Text <b>bold</b> <a rel="mw:WikiLink" href="./Link" title="Link" data-parsoid='{"stx":"simple","a":{"href":"./Link"},"sa":{"href":"link"}}'>link</a> <span about="#mwt3" typeof="mw:Transclusion" data-parsoid='{"pi":[[]]}' data-mw='{"parts":[{"template":{"target":{"wt":"ns:-1","function":"ns"},"params":{},"i":0}}]}'>-1</span> <figure class="mw-default-size" typeof="mw:File/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"caption","ak":"File in gallery caption"}]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"20","width":"180"},"sa":{"resource":"File:Foobar.jpg"}}' class="mw-file-element"/></a><figcaption>File in gallery caption</figcaption></figure></li> |
| 2637 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File" data-parsoid='{"optList":[{"ck":"width","ak":"120x120px"},{"ck":"caption","ak":"Image caption"}]}'><a href="./File:Foobar.jpg" class="mw-file-description" title="Image caption"><img alt="Image caption" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"14","width":"120"},"sa":{"resource":"File:Foobar.jpg"}}' class="mw-file-element"/></a></span></div><div class="gallerytext">Image caption</div></li> |
| 2638 |
</ul> |
| 2639 |
!! html/parsoid+integrated |
| 2640 |
<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt3" data-mw='{"name":"gallery","attrs":{},"body":{}}'> |
| 2641 |
<li class="gallerycaption"># This should not be a list item Text <b>bold</b> <a rel="mw:WikiLink" href="./Link" title="Link">link</a> <span about="#mwt2" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"ns:-1","function":"ns"},"params":{},"i":0}}]}'>Special</span> <figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a><figcaption>File in gallery caption</figcaption></figure></li> |
| 2642 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description" title="Image caption"><img alt="Image caption" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div><div class="gallerytext">Image caption</div></li> |
| 2643 |
</ul> |
| 2644 |
!! end |
| 2645 |
|
| 2646 |
!! test |
| 2647 |
Gallery with wikitext inside caption |
| 2648 |
!! config |
| 2649 |
wgParserEnableLegacyMediaDOM=true |
| 2650 |
!! wikitext |
| 2651 |
<gallery> |
| 2652 |
File:Foobar.jpg|alt=galleryalt|[[File:Foobar.jpg|alt=inneralt|20x20px|desc]] |
| 2653 |
File:Foobar.jpg|alt=galleryalt|{{Test|unamedParam|alt=param}} |
| 2654 |
</gallery> |
| 2655 |
!! html/php |
| 2656 |
<ul class="gallery mw-gallery-traditional"> |
| 2657 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 2658 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="galleryalt" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 2659 |
<div class="gallerytext"><a href="/wiki/File:Foobar.jpg" class="image" title="desc"><img alt="inneralt" src="http://example.com/images/thumb/3/3a/Foobar.jpg/20px-Foobar.jpg" decoding="async" width="20" height="2" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/30px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/40px-Foobar.jpg 2x" /></a></div> |
| 2660 |
</div></li> |
| 2661 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 2662 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image" title="This is a test template"><img alt="galleryalt" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 2663 |
<div class="gallerytext">This is a test template</div> |
| 2664 |
</div></li> |
| 2665 |
</ul> |
| 2666 |
!! html/parsoid |
| 2667 |
<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt6" data-mw='{"name":"gallery","attrs":{},"body":{}}'> |
| 2668 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description"><img alt="galleryalt" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div><div class="gallerytext"><span typeof="mw:File" data-mw='{"caption":"desc"}'><a href="./File:Foobar.jpg" class="mw-file-description" title="desc"><img alt="inneralt" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/20px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="2" width="20" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/30px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/40px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div></li> |
| 2669 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description" title="This is a test template"><img alt="galleryalt" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div><div class="gallerytext"><span about="#mwt4" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"Test","href":"./Template:Test"},"params":{"1":{"wt":"unamedParam"},"alt":{"wt":"param"}},"i":0}}]}'>This is a test template</span></div></li> |
| 2670 |
</ul> |
| 2671 |
!! end |
| 2672 |
|
| 2673 |
!! test |
| 2674 |
Gallery with wikitext incl bogus HTML tag (T237318) |
| 2675 |
!! options |
| 2676 |
parsoid=wt2html,html2html |
| 2677 |
!! config |
| 2678 |
wgParserEnableLegacyMediaDOM=true |
| 2679 |
!! wikitext |
| 2680 |
<gallery> |
| 2681 |
File:Foobar.jpg|</ref> |
| 2682 |
</gallery> |
| 2683 |
!! html/php |
| 2684 |
<ul class="gallery mw-gallery-traditional"> |
| 2685 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 2686 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image" title="</ref>"><img alt="</ref>" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 2687 |
<div class="gallerytext"></ref></div> |
| 2688 |
</div></li> |
| 2689 |
</ul> |
| 2690 |
!! html/parsoid |
| 2691 |
<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt3" data-mw='{"name":"gallery","attrs":{},"body":{}}'> |
| 2692 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description" title="</ref>"><img alt="</ref>" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div><div class="gallerytext"></ref></div></li> |
| 2693 |
</ul> |
| 2694 |
!! end |
| 2695 |
|
| 2696 |
!! test |
| 2697 |
Gallery (with showfilename option) |
| 2698 |
!! config |
| 2699 |
wgParserEnableLegacyMediaDOM=true |
| 2700 |
!! wikitext |
| 2701 |
<gallery showfilename=""> |
| 2702 |
File:Nonexistent.jpg|caption |
| 2703 |
File:Nonexistent.jpg |
| 2704 |
File:Foobar.jpg|some '''caption''' [[Main Page]] |
| 2705 |
File:Foobar.jpg |
| 2706 |
File:Redirect to foobar.jpg |
| 2707 |
</gallery> |
| 2708 |
!! html/php |
| 2709 |
<ul class="gallery mw-gallery-traditional"> |
| 2710 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 2711 |
<div class="thumb" style="height: 150px;">Nonexistent.jpg</div> |
| 2712 |
<div class="gallerytext"><a href="/wiki/File:Nonexistent.jpg" class="galleryfilename galleryfilename-truncate" title="File:Nonexistent.jpg">Nonexistent.jpg</a> |
| 2713 |
caption</div> |
| 2714 |
</div></li> |
| 2715 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 2716 |
<div class="thumb" style="height: 150px;">Nonexistent.jpg</div> |
| 2717 |
<div class="gallerytext"><a href="/wiki/File:Nonexistent.jpg" class="galleryfilename galleryfilename-truncate" title="File:Nonexistent.jpg">Nonexistent.jpg</a> |
| 2718 |
</div> |
| 2719 |
</div></li> |
| 2720 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 2721 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image" title="some caption Main Page"><img alt="some caption Main Page" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 2722 |
<div class="gallerytext"><a href="/wiki/File:Foobar.jpg" class="galleryfilename galleryfilename-truncate" title="File:Foobar.jpg">Foobar.jpg</a> |
| 2723 |
some <b>caption</b> <a href="/wiki/Main_Page" title="Main Page">Main Page</a></div> |
| 2724 |
</div></li> |
| 2725 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 2726 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 2727 |
<div class="gallerytext"><a href="/wiki/File:Foobar.jpg" class="galleryfilename galleryfilename-truncate" title="File:Foobar.jpg">Foobar.jpg</a> |
| 2728 |
</div> |
| 2729 |
</div></li> |
| 2730 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 2731 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Redirect to foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 2732 |
<div class="gallerytext"><a href="/wiki/File:Foobar.jpg" class="galleryfilename galleryfilename-truncate" title="File:Foobar.jpg">Foobar.jpg</a> |
| 2733 |
</div> |
| 2734 |
</div></li> |
| 2735 |
</ul> |
| 2736 |
!! html/parsoid+integrated |
| 2737 |
<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt3" data-mw='{"name":"gallery","attrs":{"showfilename":""},"body":{}}'> |
| 2738 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:Error mw:File" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Nonexistent.jpg"><span class="mw-file-element mw-broken-media" resource="./File:Nonexistent.jpg" data-width="120" data-height="120">caption</span></a></span></div><div class="gallerytext"><a href="./File:Nonexistent.jpg" class="galleryfilename galleryfilename-truncate" title="File:Nonexistent.jpg">File:Nonexistent.jpg</a>caption</div></li> |
| 2739 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:Error mw:File" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Nonexistent.jpg"><span class="mw-file-element mw-broken-media" resource="./File:Nonexistent.jpg" data-width="120" data-height="120">File:Nonexistent.jpg</span></a></span></div><div class="gallerytext"><a href="./File:Nonexistent.jpg" class="galleryfilename galleryfilename-truncate" title="File:Nonexistent.jpg">File:Nonexistent.jpg</a></div></li> |
| 2740 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description" title="some caption Main Page"><img alt="some caption Main Page" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div><div class="gallerytext"><a href="./File:Foobar.jpg" class="galleryfilename galleryfilename-truncate" title="File:Foobar.jpg">File:Foobar.jpg</a>some <b>caption</b> <a rel="mw:WikiLink" href="./Main_Page" title="Main Page">Main Page</a></div></li> |
| 2741 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div><div class="gallerytext"><a href="./File:Foobar.jpg" class="galleryfilename galleryfilename-truncate" title="File:Foobar.jpg">File:Foobar.jpg</a></div></li> |
| 2742 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div><div class="gallerytext"><a href="./File:Foobar.jpg" class="galleryfilename galleryfilename-truncate" title="File:Foobar.jpg">File:Foobar.jpg</a></div></li> |
| 2743 |
</ul> |
| 2744 |
!! end |
| 2745 |
|
| 2746 |
## Should Parsoid be preserving these variations? See T151367 |
| 2747 |
!! test |
| 2748 |
Gallery (with namespace-less filenames) |
| 2749 |
!! options |
| 2750 |
parsoid={ |
| 2751 |
"modes": ["wt2html", "html2html"] |
| 2752 |
} |
| 2753 |
!! config |
| 2754 |
wgParserEnableLegacyMediaDOM=true |
| 2755 |
!! wikitext |
| 2756 |
<gallery> |
| 2757 |
File:Nonexistent.jpg |
| 2758 |
Nonexistent.jpg |
| 2759 |
image:foobar.jpg |
| 2760 |
foobar.jpg |
| 2761 |
</gallery> |
| 2762 |
!! html/php |
| 2763 |
<ul class="gallery mw-gallery-traditional"> |
| 2764 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 2765 |
<div class="thumb" style="height: 150px;">Nonexistent.jpg</div> |
| 2766 |
<div class="gallerytext"></div> |
| 2767 |
</div></li> |
| 2768 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 2769 |
<div class="thumb" style="height: 150px;">Nonexistent.jpg</div> |
| 2770 |
<div class="gallerytext"></div> |
| 2771 |
</div></li> |
| 2772 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 2773 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 2774 |
<div class="gallerytext"></div> |
| 2775 |
</div></li> |
| 2776 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 2777 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 2778 |
<div class="gallerytext"></div> |
| 2779 |
</div></li> |
| 2780 |
</ul> |
| 2781 |
!! html/parsoid |
| 2782 |
<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt3" data-mw='{"name":"gallery","attrs":{},"body":{}}'> |
| 2783 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="height: 150px;"><span typeof="mw:Error mw:File" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Nonexistent.jpg"><span class="mw-file-element mw-broken-media" resource="./File:Nonexistent.jpg" data-width="120" data-height="120">File:Nonexistent.jpg</span></a></span></div><div class="gallerytext"></div></li> |
| 2784 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="height: 150px;"><span typeof="mw:Error mw:File" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Nonexistent.jpg"><span class="mw-file-element mw-broken-media" resource="./File:Nonexistent.jpg" data-width="120" data-height="120">File:Nonexistent.jpg</span></a></span></div><div class="gallerytext"></div></li> |
| 2785 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div><div class="gallerytext"></div></li> |
| 2786 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div><div class="gallerytext"></div></li> |
| 2787 |
</ul> |
| 2788 |
!! end |
| 2789 |
|
| 2790 |
!! test |
| 2791 |
Gallery override link with wikilink (T36852) |
| 2792 |
!! config |
| 2793 |
wgParserEnableLegacyMediaDOM=true |
| 2794 |
!! wikitext |
| 2795 |
<gallery> |
| 2796 |
File:Foobar.jpg|link=Wikilink|alt=galleryalt |
| 2797 |
</gallery> |
| 2798 |
!! html/php |
| 2799 |
<ul class="gallery mw-gallery-traditional"> |
| 2800 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 2801 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/Wikilink" title="Wikilink"><img alt="galleryalt" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 2802 |
<div class="gallerytext"></div> |
| 2803 |
</div></li> |
| 2804 |
</ul> |
| 2805 |
!! html/parsoid |
| 2806 |
<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","attrs":{},"body":{}}'> |
| 2807 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File"><a href="./Wikilink" title="Wikilink"><img alt="galleryalt" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div><div class="gallerytext"></div></li> |
| 2808 |
</ul> |
| 2809 |
!! end |
| 2810 |
|
| 2811 |
!! test |
| 2812 |
Gallery override link with absolute external link (T36852) |
| 2813 |
!! config |
| 2814 |
wgParserEnableLegacyMediaDOM=true |
| 2815 |
!! wikitext |
| 2816 |
<gallery> |
| 2817 |
File:Foobar.jpg|alt=galleryalt|link=http://www.example.org |
| 2818 |
</gallery> |
| 2819 |
!! html/php |
| 2820 |
<ul class="gallery mw-gallery-traditional"> |
| 2821 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 2822 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="http://www.example.org" rel="nofollow"><img alt="galleryalt" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 2823 |
<div class="gallerytext"></div> |
| 2824 |
</div></li> |
| 2825 |
</ul> |
| 2826 |
!! html/parsoid |
| 2827 |
<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","attrs":{},"body":{}}'> |
| 2828 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File" data-parsoid='{"optList":[{"ck":"alt","ak":"alt=galleryalt"},{"ck":"link","ak":"link=http://www.example.org"},{"ck":"width","ak":"120x120px"}]}'><a href="http://www.example.org"><img alt="galleryalt" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div><div class="gallerytext"></div></li> |
| 2829 |
</ul> |
| 2830 |
!! end |
| 2831 |
|
| 2832 |
## Putting the caption at the end here runs into T49646 on the php side |
| 2833 |
## so reducing the modes this runs in Parsoid |
| 2834 |
!! test |
| 2835 |
Gallery override link with absolute external link with LanguageConverter |
| 2836 |
!! options |
| 2837 |
language=zh |
| 2838 |
parsoid=wt2html,html2html |
| 2839 |
!! config |
| 2840 |
wgParserEnableLegacyMediaDOM=true |
| 2841 |
!! wikitext |
| 2842 |
<gallery> |
| 2843 |
File:foobar.jpg|caption|alt=galleryalt|link=http://www.example.org |
| 2844 |
</gallery> |
| 2845 |
!! html/php |
| 2846 |
<ul class="gallery mw-gallery-traditional"> |
| 2847 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 2848 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="http://www.example.org" title="caption" rel="nofollow"><img alt="galleryalt" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 2849 |
<div class="gallerytext">caption</div> |
| 2850 |
</div></li> |
| 2851 |
</ul> |
| 2852 |
!! html/parsoid |
| 2853 |
<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","attrs":{},"body":{}}'> |
| 2854 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File"><a href="http://www.example.org" title="caption"><img alt="galleryalt" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div><div class="gallerytext">caption</div></li> |
| 2855 |
</ul> |
| 2856 |
!! end |
| 2857 |
|
| 2858 |
!! test |
| 2859 |
Gallery override link with malicious javascript (T36852) |
| 2860 |
!! options |
| 2861 |
parsoid={ |
| 2862 |
"modes": ["wt2html", "html2html"] |
| 2863 |
} |
| 2864 |
!! config |
| 2865 |
wgParserEnableLegacyMediaDOM=true |
| 2866 |
!! wikitext |
| 2867 |
<gallery> |
| 2868 |
File:Foobar.jpg|alt=galleryalt|link=" onclick="alert('malicious javascript code!'); |
| 2869 |
</gallery> |
| 2870 |
!! html/php |
| 2871 |
<ul class="gallery mw-gallery-traditional"> |
| 2872 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 2873 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/%22_onclick%3D%22alert(%27malicious_javascript_code!%27);" title="" onclick="alert('malicious javascript code!');"><img alt="galleryalt" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 2874 |
<div class="gallerytext"></div> |
| 2875 |
</div></li> |
| 2876 |
</ul> |
| 2877 |
!! html/parsoid |
| 2878 |
<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","attrs":{},"body":{}}'> |
| 2879 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File"><a href="./"_onclick="alert('malicious_javascript_code!');" title="" onclick="alert('malicious javascript code!');"><img alt="galleryalt" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div><div class="gallerytext"></div></li> |
| 2880 |
</ul> |
| 2881 |
!! end |
| 2882 |
|
| 2883 |
!! test |
| 2884 |
Gallery with invalid title as link (T45964) |
| 2885 |
!! options |
| 2886 |
parsoid={ |
| 2887 |
"modes": ["wt2html", "html2html"] |
| 2888 |
} |
| 2889 |
!! config |
| 2890 |
wgParserEnableLegacyMediaDOM=true |
| 2891 |
!! wikitext |
| 2892 |
<gallery> |
| 2893 |
File:Foobar.jpg|link=< |
| 2894 |
</gallery> |
| 2895 |
!! html/php |
| 2896 |
<ul class="gallery mw-gallery-traditional"> |
| 2897 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 2898 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 2899 |
<div class="gallerytext"></div> |
| 2900 |
</div></li> |
| 2901 |
</ul> |
| 2902 |
!! html/parsoid |
| 2903 |
<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","attrs":{},"body":{}}'> |
| 2904 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File" data-parsoid='{"optList":[{"ck":"link","ak":"link=<"},{"ck":"width","ak":"120x120px"}]}' data-mw='{"attribs":[["link",{"txt":"<"}]]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div><div class="gallerytext"></div></li> |
| 2905 |
</ul> |
| 2906 |
!! end |
| 2907 |
|
| 2908 |
!! test |
| 2909 |
Serialize gallery without attrs in data-mw |
| 2910 |
!! options |
| 2911 |
parsoid={ |
| 2912 |
"modes": ["html2wt"] |
| 2913 |
} |
| 2914 |
!! html/parsoid |
| 2915 |
<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","body":{}}'> |
| 2916 |
<li class="gallerycaption">123</li> |
| 2917 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:Error mw:File" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Test.png"><span class="mw-file-element mw-broken-media" resource="./File:Test.png" data-width="120" data-height="120">File:Test.png</span></a></span></div><div class="gallerytext"></div></li> |
| 2918 |
</ul> |
| 2919 |
!! wikitext |
| 2920 |
<gallery caption="123"> |
| 2921 |
File:Test.png |
| 2922 |
</gallery> |
| 2923 |
!! end |
| 2924 |
|
| 2925 |
!! test |
| 2926 |
Gallery with class and style attributes |
| 2927 |
!! config |
| 2928 |
wgParserEnableLegacyMediaDOM=true |
| 2929 |
!! wikitext |
| 2930 |
<gallery class="center" style="text-align: center;"> |
| 2931 |
File:Foobar.jpg |
| 2932 |
</gallery> |
| 2933 |
!! html/php |
| 2934 |
<ul class="gallery mw-gallery-traditional center" style="text-align: center;"> |
| 2935 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 2936 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 2937 |
<div class="gallerytext"></div> |
| 2938 |
</div></li> |
| 2939 |
</ul> |
| 2940 |
!! html/parsoid |
| 2941 |
<ul class="gallery mw-gallery-traditional center" style="text-align: center;" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","attrs":{"class":"center","style":"text-align: center;"},"body":{}}'> |
| 2942 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div><div class="gallerytext"></div></li> |
| 2943 |
</ul> |
| 2944 |
!! end |
| 2945 |
|
| 2946 |
!! test |
| 2947 |
Gallery in nolines mode |
| 2948 |
!! config |
| 2949 |
wgParserEnableLegacyMediaDOM=true |
| 2950 |
!! wikitext |
| 2951 |
<gallery mode="nolines" showfilenames="yes" caption="No Lines!"> |
| 2952 |
File:Foobar.jpg|foo |
| 2953 |
</gallery> |
| 2954 |
!! html/php |
| 2955 |
<ul class="gallery mw-gallery-nolines"> |
| 2956 |
<li class="gallerycaption">No Lines!</li> |
| 2957 |
<li class="gallerybox" style="width: 125px"><div style="width: 125px"> |
| 2958 |
<div class="thumb" style="width: 120px;"><div style="margin:0px auto;"><a href="/wiki/File:Foobar.jpg" class="image" title="foo"><img alt="foo" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 2959 |
<div class="gallerytext">foo</div> |
| 2960 |
</div></li> |
| 2961 |
</ul> |
| 2962 |
!! html/parsoid |
| 2963 |
<ul class="gallery mw-gallery-nolines" typeof="mw:Extension/gallery" about="#mwt3" data-mw='{"name":"gallery","attrs":{"mode":"nolines","showfilenames":"yes"},"body":{}}'> |
| 2964 |
<li class="gallerycaption">No Lines!</li> |
| 2965 |
<li class="gallerybox" style="width: 125px;"><div class="thumb" style="width: 120px;"><span typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description" title="foo"><img alt="foo" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div><div class="gallerytext">foo</div></li> |
| 2966 |
</ul> |
| 2967 |
!! end |
| 2968 |
|
| 2969 |
!! test |
| 2970 |
Gallery in slideshow mode |
| 2971 |
!! config |
| 2972 |
wgParserEnableLegacyMediaDOM=true |
| 2973 |
!! wikitext |
| 2974 |
<gallery mode="slideshow" showthumbnails=""> |
| 2975 |
File:Foobar.jpg |
| 2976 |
</gallery> |
| 2977 |
!! html/php |
| 2978 |
<ul class="gallery mw-gallery-slideshow" data-showthumbnails="1"> |
| 2979 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 2980 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 2981 |
<div class="gallerytext"></div> |
| 2982 |
</div></li> |
| 2983 |
</ul> |
| 2984 |
!! html/parsoid |
| 2985 |
<ul class="gallery mw-gallery-slideshow" data-showthumbnails="1" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","attrs":{"mode":"slideshow","showthumbnails":""},"body":{}}'> |
| 2986 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px;"><span typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div><div class="gallerytext"></div></li> |
| 2987 |
</ul> |
| 2988 |
!! end |
| 2989 |
|
| 2990 |
!! test |
| 2991 |
Gallery in packed mode |
| 2992 |
!! config |
| 2993 |
wgParserEnableLegacyMediaDOM=true |
| 2994 |
!! wikitext |
| 2995 |
<gallery mode="packed"> |
| 2996 |
File:Foobar.jpg |
| 2997 |
</gallery> |
| 2998 |
!! html/php |
| 2999 |
<ul class="gallery mw-gallery-packed"> |
| 3000 |
<li class="gallerybox" style="width: 1061.3333333333px"><div style="width: 1061.3333333333px"> |
| 3001 |
<div class="thumb" style="width: 1059.3333333333px;"><div style="margin:0px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/1589px-Foobar.jpg" decoding="async" width="1060" height="120" srcset="http://example.com/images/3/3a/Foobar.jpg 1.5x" /></a></div></div> |
| 3002 |
<div class="gallerytext"></div> |
| 3003 |
</div></li> |
| 3004 |
</ul> |
| 3005 |
!! html/parsoid |
| 3006 |
<ul class="gallery mw-gallery-packed" typeof="mw:Extension/gallery" about="#mwt3" data-mw='{"name":"gallery","attrs":{"mode":"packed"},"body":{}}'> |
| 3007 |
<li class="gallerybox" style="width: 1061.3333333333px;"><div class="thumb" style="width: 1059.3333333333px;"><span typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/1589px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="120" width="1060" srcset="http://example.com/images/3/3a/Foobar.jpg 1.5x, http://example.com/images/3/3a/Foobar.jpg 2x" class="mw-file-element"/></a></span></div><div class="gallerytext"></div></li> |
| 3008 |
</ul> |
| 3009 |
!! end |
| 3010 |
|
| 3011 |
!! test |
| 3012 |
Gallery in packed-overlay mode |
| 3013 |
!! config |
| 3014 |
wgParserEnableLegacyMediaDOM=true |
| 3015 |
!! wikitext |
| 3016 |
<gallery mode="packed-overlay" showfilenames="yes" caption="Packed Overlay!"> |
| 3017 |
File:Foobar.jpg|foo |
| 3018 |
</gallery> |
| 3019 |
!! html/php |
| 3020 |
<ul class="gallery mw-gallery-packed-overlay"> |
| 3021 |
<li class="gallerycaption">Packed Overlay!</li> |
| 3022 |
<li class="gallerybox" style="width: 1061.3333333333px"><div style="width: 1061.3333333333px"> |
| 3023 |
<div class="thumb" style="width: 1059.3333333333px;"><div style="margin:0px auto;"><a href="/wiki/File:Foobar.jpg" class="image" title="foo"><img alt="foo" src="http://example.com/images/thumb/3/3a/Foobar.jpg/1589px-Foobar.jpg" decoding="async" width="1060" height="120" srcset="http://example.com/images/3/3a/Foobar.jpg 1.5x" /></a></div></div> |
| 3024 |
<div class="gallerytextwrapper" style="width: 1040px"><div class="gallerytext">foo</div> |
| 3025 |
</div> |
| 3026 |
</div></li> |
| 3027 |
</ul> |
| 3028 |
!! html/parsoid |
| 3029 |
<ul class="gallery mw-gallery-packed-overlay" typeof="mw:Extension/gallery" about="#mwt3" data-mw='{"name":"gallery","attrs":{"mode":"packed-overlay","showfilenames":"yes"},"body":{}}'> |
| 3030 |
<li class="gallerycaption">Packed Overlay!</li> |
| 3031 |
<li class="gallerybox" style="width: 1061.3333333333px;"><div class="thumb" style="width: 1059.3333333333px;"><span typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description" title="foo"><img alt="foo" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/1589px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="120" width="1060" srcset="http://example.com/images/3/3a/Foobar.jpg 1.5x, http://example.com/images/3/3a/Foobar.jpg 2x" class="mw-file-element"/></a></span></div><div class="gallerytextwrapper" style="width: 1040px;"><div class="gallerytext">foo</div></div></li> |
| 3032 |
</ul> |
| 3033 |
!! end |
| 3034 |
|
| 3035 |
!! test |
| 3036 |
Gallery in packed-hover mode |
| 3037 |
!! config |
| 3038 |
wgParserEnableLegacyMediaDOM=true |
| 3039 |
!! wikitext |
| 3040 |
<gallery mode="packed-hover" showfilenames="yes" caption="Packed Hover!"> |
| 3041 |
File:Foobar.jpg|foo |
| 3042 |
</gallery> |
| 3043 |
!! html/php |
| 3044 |
<ul class="gallery mw-gallery-packed-hover"> |
| 3045 |
<li class="gallerycaption">Packed Hover!</li> |
| 3046 |
<li class="gallerybox" style="width: 1061.3333333333px"><div style="width: 1061.3333333333px"> |
| 3047 |
<div class="thumb" style="width: 1059.3333333333px;"><div style="margin:0px auto;"><a href="/wiki/File:Foobar.jpg" class="image" title="foo"><img alt="foo" src="http://example.com/images/thumb/3/3a/Foobar.jpg/1589px-Foobar.jpg" decoding="async" width="1060" height="120" srcset="http://example.com/images/3/3a/Foobar.jpg 1.5x" /></a></div></div> |
| 3048 |
<div class="gallerytextwrapper" style="width: 1040px"><div class="gallerytext">foo</div> |
| 3049 |
</div> |
| 3050 |
</div></li> |
| 3051 |
</ul> |
| 3052 |
!! html/parsoid |
| 3053 |
<ul class="gallery mw-gallery-packed-hover" typeof="mw:Extension/gallery" about="#mwt3" data-mw='{"name":"gallery","attrs":{"mode":"packed-hover","showfilenames":"yes"},"body":{}}'> |
| 3054 |
<li class="gallerycaption">Packed Hover!</li> |
| 3055 |
<li class="gallerybox" style="width: 1061.3333333333px;"><div class="thumb" style="width: 1059.3333333333px;"><span typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description" title="foo"><img alt="foo" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/1589px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="120" width="1060" srcset="http://example.com/images/3/3a/Foobar.jpg 1.5x, http://example.com/images/3/3a/Foobar.jpg 2x" class="mw-file-element"/></a></span></div><div class="gallerytextwrapper" style="width: 1040px;"><div class="gallerytext">foo</div></div></li> |
| 3056 |
</ul> |
| 3057 |
!! end |
| 3058 |
|
| 3059 |
!! test |
| 3060 |
Serialize gallery image captions on a line |
| 3061 |
!! options |
| 3062 |
parsoid={ |
| 3063 |
"modes": ["html2wt"] |
| 3064 |
} |
| 3065 |
!! html/parsoid |
| 3066 |
<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","attrs":{},"body":{}}'> |
| 3067 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px;"><span typeof="mw:File"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></span></div><div class="gallerytext"><p>hi</p><p>ho</p></div></li> |
| 3068 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px;"><span typeof="mw:File"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></span></div><div class="gallerytext">hi<br />ho</div></li> |
| 3069 |
</ul> |
| 3070 |
!! wikitext |
| 3071 |
<gallery> |
| 3072 |
File:Foobar.jpg| hi ho |
| 3073 |
File:Foobar.jpg|hi<br />ho |
| 3074 |
</gallery> |
| 3075 |
!! end |
| 3076 |
|
| 3077 |
!! test |
| 3078 |
Centre-aligned image |
| 3079 |
!! config |
| 3080 |
wgParserEnableLegacyMediaDOM=true |
| 3081 |
!! wikitext |
| 3082 |
[[Image:foobar.jpg|centre]] |
| 3083 |
!! html/php |
| 3084 |
<div class="center"><div class="floatnone"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a></div></div> |
| 3085 |
!! html/parsoid |
| 3086 |
<figure class="mw-default-size mw-halign-center" typeof="mw:File" data-parsoid='{"optList":[{"ck":"center","ak":"centre"}]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"220","width":"1941"},"sa":{"resource":"Image:foobar.jpg"}}' class="mw-file-element"/></a><figcaption></figcaption></figure> |
| 3087 |
!! end |
| 3088 |
|
| 3089 |
!! test |
| 3090 |
None-aligned image |
| 3091 |
!! config |
| 3092 |
wgParserEnableLegacyMediaDOM=true |
| 3093 |
!! wikitext |
| 3094 |
[[Image:foobar.jpg|none]] |
| 3095 |
!! html/php |
| 3096 |
<div class="floatnone"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a></div> |
| 3097 |
!! html/parsoid |
| 3098 |
<figure class="mw-default-size mw-halign-none" typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"220","width":"1941"},"sa":{"resource":"Image:foobar.jpg"}}' class="mw-file-element"/></a><figcaption></figcaption></figure> |
| 3099 |
!! end |
| 3100 |
|
| 3101 |
!! test |
| 3102 |
Width + Height sized image (using px) (height is ignored) |
| 3103 |
!! config |
| 3104 |
wgParserEnableLegacyMediaDOM=true |
| 3105 |
!! wikitext |
| 3106 |
[[Image:foobar.jpg|640x480px]] |
| 3107 |
!! html/php |
| 3108 |
<p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" decoding="async" width="640" height="73" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/960px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/1280px-Foobar.jpg 2x" /></a> |
| 3109 |
</p> |
| 3110 |
!! html/parsoid |
| 3111 |
<p><span typeof="mw:File" data-parsoid='{"optList":[{"ck":"width","ak":"640x480px"}]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="73" width="640" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/960px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/1280px-Foobar.jpg 2x" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"73","width":"640"},"sa":{"resource":"Image:foobar.jpg"}}' class="mw-file-element"/></a></span></p> |
| 3112 |
!! end |
| 3113 |
|
| 3114 |
!! test |
| 3115 |
Width-sized image (using px, no following whitespace) |
| 3116 |
!! config |
| 3117 |
wgParserEnableLegacyMediaDOM=true |
| 3118 |
!! wikitext |
| 3119 |
[[Image:foobar.jpg|640px]] |
| 3120 |
!! html/php |
| 3121 |
<p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" decoding="async" width="640" height="73" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/960px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/1280px-Foobar.jpg 2x" /></a> |
| 3122 |
</p> |
| 3123 |
!! html/parsoid |
| 3124 |
<p><span typeof="mw:File" data-parsoid='{"optList":[{"ck":"width","ak":"640px"}]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="73" width="640" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/960px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/1280px-Foobar.jpg 2x" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"73","width":"640"},"sa":{"resource":"Image:foobar.jpg"}}' class="mw-file-element"/></a></span></p> |
| 3125 |
!! end |
| 3126 |
|
| 3127 |
!! test |
| 3128 |
Width-sized image (using px, with following whitespace - test regression from r39467) |
| 3129 |
!! config |
| 3130 |
wgParserEnableLegacyMediaDOM=true |
| 3131 |
!! wikitext |
| 3132 |
[[Image:foobar.jpg|640px ]] |
| 3133 |
!! html/php |
| 3134 |
<p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" decoding="async" width="640" height="73" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/960px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/1280px-Foobar.jpg 2x" /></a> |
| 3135 |
</p> |
| 3136 |
!! html/parsoid |
| 3137 |
<p><span typeof="mw:File" data-parsoid='{"optList":[{"ck":"width","ak":"640px "}]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="73" width="640" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/960px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/1280px-Foobar.jpg 2x" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"73","width":"640"},"sa":{"resource":"Image:foobar.jpg"}}' class="mw-file-element"/></a></span></p> |
| 3138 |
!! end |
| 3139 |
|
| 3140 |
!! test |
| 3141 |
Width-sized image (using px, with preceding whitespace - test regression from r39467) |
| 3142 |
!! config |
| 3143 |
wgParserEnableLegacyMediaDOM=true |
| 3144 |
!! wikitext |
| 3145 |
[[Image:foobar.jpg| 640px]] |
| 3146 |
!! html/php |
| 3147 |
<p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" decoding="async" width="640" height="73" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/960px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/1280px-Foobar.jpg 2x" /></a> |
| 3148 |
</p> |
| 3149 |
!! html/parsoid |
| 3150 |
<p><span typeof="mw:File" data-parsoid='{"optList":[{"ck":"width","ak":" 640px"}]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="73" width="640" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/960px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/1280px-Foobar.jpg 2x" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"73","width":"640"},"sa":{"resource":"Image:foobar.jpg"}}' class="mw-file-element"/></a></span></p> |
| 3151 |
!! end |
| 3152 |
|
| 3153 |
!! test |
| 3154 |
Image with page parameter |
| 3155 |
!! options |
| 3156 |
djvu |
| 3157 |
!! config |
| 3158 |
wgParserEnableLegacyMediaDOM=true |
| 3159 |
!! wikitext |
| 3160 |
[[File:LoremIpsum.djvu]] |
| 3161 |
|
| 3162 |
[[File:LoremIpsum.djvu|page=2]] |
| 3163 |
!! html/php |
| 3164 |
<p><a href="/wiki/File:LoremIpsum.djvu" class="image"><img alt="LoremIpsum.djvu" src="http://example.com/images/thumb/5/5f/LoremIpsum.djvu/page1-2480px-LoremIpsum.djvu.jpg" decoding="async" width="2480" height="3508" srcset="http://example.com/images/thumb/5/5f/LoremIpsum.djvu/page1-3720px-LoremIpsum.djvu.jpg 1.5x, http://example.com/images/thumb/5/5f/LoremIpsum.djvu/page1-4960px-LoremIpsum.djvu.jpg 2x" /></a> |
| 3165 |
</p><p><a href="/index.php?title=File:LoremIpsum.djvu&page=2" class="image"><img alt="LoremIpsum.djvu" src="http://example.com/images/thumb/5/5f/LoremIpsum.djvu/page2-2480px-LoremIpsum.djvu.jpg" decoding="async" width="2480" height="3508" srcset="http://example.com/images/thumb/5/5f/LoremIpsum.djvu/page2-3720px-LoremIpsum.djvu.jpg 1.5x, http://example.com/images/thumb/5/5f/LoremIpsum.djvu/page2-4960px-LoremIpsum.djvu.jpg 2x" /></a> |
| 3166 |
</p> |
| 3167 |
!! html/parsoid |
| 3168 |
<p><span class="mw-default-size" typeof="mw:File"><a href="./File:LoremIpsum.djvu" class="mw-file-description"><img resource="./File:LoremIpsum.djvu" src="http://example.com/images/thumb/5/5f/LoremIpsum.djvu/page1-2480px-LoremIpsum.djvu.jpg" decoding="async" data-file-width="2480" data-file-height="3508" data-file-type="office" height="3508" width="2480" srcset="http://example.com/images/thumb/5/5f/LoremIpsum.djvu/page1-3720px-LoremIpsum.djvu.jpg 1.5x, http://example.com/images/thumb/5/5f/LoremIpsum.djvu/page1-4960px-LoremIpsum.djvu.jpg 2x" class="mw-file-element"/></a></span></p> |
| 3169 |
<p><span class="mw-default-size" typeof="mw:File" data-mw='{"attribs":[["page",{"txt":"2"}]]}'><a href="./File:LoremIpsum.djvu?page=2" class="mw-file-description"><img resource="./File:LoremIpsum.djvu" src="http://example.com/images/thumb/5/5f/LoremIpsum.djvu/page2-2480px-LoremIpsum.djvu.jpg" decoding="async" data-file-width="2480" data-file-height="3508" data-file-type="office" height="3508" width="2480" srcset="http://example.com/images/thumb/5/5f/LoremIpsum.djvu/page2-3720px-LoremIpsum.djvu.jpg 1.5x, http://example.com/images/thumb/5/5f/LoremIpsum.djvu/page2-4960px-LoremIpsum.djvu.jpg 2x" class="mw-file-element"/></a></span></p> |
| 3170 |
!! end |
| 3171 |
|
| 3172 |
!! test |
| 3173 |
Image with page parameter generated by a template |
| 3174 |
!! options |
| 3175 |
djvu |
| 3176 |
!! config |
| 3177 |
wgParserEnableLegacyMediaDOM=true |
| 3178 |
!! wikitext |
| 3179 |
[[File:LoremIpsum.djvu|page={{1x|2}}]] |
| 3180 |
!! html/php |
| 3181 |
<p><a href="/index.php?title=File:LoremIpsum.djvu&page=2" class="image"><img alt="LoremIpsum.djvu" src="http://example.com/images/thumb/5/5f/LoremIpsum.djvu/page2-2480px-LoremIpsum.djvu.jpg" decoding="async" width="2480" height="3508" srcset="http://example.com/images/thumb/5/5f/LoremIpsum.djvu/page2-3720px-LoremIpsum.djvu.jpg 1.5x, http://example.com/images/thumb/5/5f/LoremIpsum.djvu/page2-4960px-LoremIpsum.djvu.jpg 2x" /></a> |
| 3182 |
</p> |
| 3183 |
!! html/parsoid |
| 3184 |
<p><span class="mw-default-size" typeof="mw:File mw:ExpandedAttrs" data-mw='{"attribs":[["page",{"html":"page=<span typeof=\"mw:Transclusion\" data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"1x\",\"href\":\"./Template:1x\"},\"params\":{\"1\":{\"wt\":\"2\"}},\"i\":0}}]}'>2</span>","txt":"2"}]]}'><a href="./File:LoremIpsum.djvu?page=2" class="mw-file-description"><img resource="./File:LoremIpsum.djvu" src="http://example.com/images/thumb/5/5f/LoremIpsum.djvu/page2-2480px-LoremIpsum.djvu.jpg" decoding="async" data-file-width="2480" data-file-height="3508" data-file-type="office" height="3508" width="2480" srcset="http://example.com/images/thumb/5/5f/LoremIpsum.djvu/page2-3720px-LoremIpsum.djvu.jpg 1.5x, http://example.com/images/thumb/5/5f/LoremIpsum.djvu/page2-4960px-LoremIpsum.djvu.jpg 2x" class="mw-file-element"/></a></span></p> |
| 3185 |
!! end |
| 3186 |
|
| 3187 |
!! test |
| 3188 |
Image with modified page parameter; serialize data-mw not href query |
| 3189 |
!! options |
| 3190 |
djvu |
| 3191 |
parsoid={ |
| 3192 |
"modes": ["wt2wt", "selser"], |
| 3193 |
"changes": [ |
| 3194 |
["a[href]", "attr", "href", "./File:LoremIpsum.djvu?page=3"] |
| 3195 |
] |
| 3196 |
} |
| 3197 |
!! wikitext |
| 3198 |
[[File:LoremIpsum.djvu|page 2]] |
| 3199 |
|
| 3200 |
[[File:LoremIpsum.djvu|page {{1x|2}}]] |
| 3201 |
!! wikitext/edited |
| 3202 |
[[File:LoremIpsum.djvu|page 2]] |
| 3203 |
|
| 3204 |
[[File:LoremIpsum.djvu|page {{1x|2}}]] |
| 3205 |
!! end |
| 3206 |
|
| 3207 |
!! test |
| 3208 |
Image with modified page parameter; serialize data-mw not href query (2) |
| 3209 |
!! options |
| 3210 |
djvu |
| 3211 |
parsoid={ |
| 3212 |
"modes": ["wt2wt", "selser"], |
| 3213 |
"changes": [ |
| 3214 |
["span", "attr", "data-mw", "{}"] |
| 3215 |
] |
| 3216 |
} |
| 3217 |
!! wikitext |
| 3218 |
[[File:LoremIpsum.djvu|page 2]] |
| 3219 |
|
| 3220 |
[[File:LoremIpsum.djvu|page {{1x|2}}]] |
| 3221 |
!! wikitext/edited |
| 3222 |
[[File:LoremIpsum.djvu]] |
| 3223 |
|
| 3224 |
[[File:LoremIpsum.djvu]] |
| 3225 |
!! end |
| 3226 |
|
| 3227 |
# Images with the "|" character in external URLs in comment tags; Eats half the comment, leaves unmatched "</a>" tag. |
| 3228 |
!! test |
| 3229 |
Images with the "|" character in the comment |
| 3230 |
!! config |
| 3231 |
wgParserEnableLegacyMediaDOM=true |
| 3232 |
!! wikitext |
| 3233 |
[[File:Foobar.jpg|thumb|An [http://test/?param1=|left|¶m2=|x external] URL]] |
| 3234 |
!! html/php |
| 3235 |
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>An <a rel="nofollow" class="external text" href="http://test/?param1=%7Cleft%7C&param2=%7Cx">external</a> URL</div></div></div> |
| 3236 |
!! html/parsoid |
| 3237 |
<figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a><figcaption>An <a rel="mw:ExtLink" href="http://test/?param1=%7Cleft%7C&param2=%7Cx" class="external text" data-parsoid='{"a":{"href":"http://test/?param1=%7Cleft%7C&param2=%7Cx"},"sa":{"href":"http://test/?param1=|left|&param2=|x"}}'>external</a> URL</figcaption></figure> |
| 3238 |
!! end |
| 3239 |
|
| 3240 |
!! test |
| 3241 |
T146305: Don't break image parsing if language converter markup is in the caption. |
| 3242 |
!! options |
| 3243 |
language=sr |
| 3244 |
!! config |
| 3245 |
wgParserEnableLegacyMediaDOM=true |
| 3246 |
!! wikitext |
| 3247 |
[[Датотека:Foobar.jpg|thumb|-{R|caption:}-]] |
| 3248 |
!! html/php |
| 3249 |
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/%D0%94%D0%B0%D1%82%D0%BE%D1%82%D0%B5%D0%BA%D0%B0:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/%D0%94%D0%B0%D1%82%D0%BE%D1%82%D0%B5%D0%BA%D0%B0:Foobar.jpg" class="internal" title="Повећајте"></a></div>caption:</div></div></div> |
| 3250 |
!! html/parsoid |
| 3251 |
<figure class="mw-default-size" typeof="mw:File/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"}]}'><a href="./Датотека:Foobar.jpg" class="mw-file-description"><img resource="./Датотека:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a><figcaption><span typeof="mw:LanguageVariant" data-mw-variant='{"disabled":{"t":"caption:"}}' data-parsoid='{"fl":["R"]}'></span></figcaption></figure> |
| 3252 |
!! end |
| 3253 |
|
| 3254 |
!! test |
| 3255 |
T146305: Don't break image parsing if nested language converter markup is in the caption. |
| 3256 |
!! options |
| 3257 |
language=zh htmlVariantLanguage=zh-Hans-CN |
| 3258 |
!! config |
| 3259 |
wgParserEnableLegacyMediaDOM=true |
| 3260 |
!! wikitext |
| 3261 |
[[File:Foobar.jpg|thumb|-{|zh-cn:blog (hk: -{zh-hans|WEBJOURNAL}-, tw: -{zh-hans|WEBLOG}-)}-]] |
| 3262 |
!! html/php |
| 3263 |
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="放大"></a></div>blog (hk: WEBJOURNAL, tw: WEBLOG)</div></div></div> |
| 3264 |
!! html/parsoid |
| 3265 |
<figure class="mw-default-size" typeof="mw:File/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"}]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a><figcaption><span typeof="mw:LanguageVariant" data-mw-variant='{"twoway":[{"l":"zh-cn","t":"blog (hk: <span typeof=\"mw:LanguageVariant\" data-mw-variant='{\"filter\":{\"l\":[\"zh-hans\"],\"t\":\"WEBJOURNAL\"}}' data-parsoid='{\"fl\":[\"zh-hans\"],\"dsr\":[43,65,2,2]}'></span>, tw: <span typeof=\"mw:LanguageVariant\" data-mw-variant='{\"filter\":{\"l\":[\"zh-hans\"],\"t\":\"WEBLOG\"}}' data-parsoid='{\"fl\":[\"zh-hans\"],\"dsr\":[71,89,2,2]}'></span>)"}]}'></span></figcaption></figure> |
| 3266 |
!! end |
| 3267 |
|
| 3268 |
# XXX html2wt disabled because rich markup in alt is not preserved. |
| 3269 |
!! test |
| 3270 |
Don't break gallery if language converter markup is inside. |
| 3271 |
!! options |
| 3272 |
language=zh |
| 3273 |
parsoid=wt2html,html2html |
| 3274 |
!! config |
| 3275 |
wgParserEnableLegacyMediaDOM=true |
| 3276 |
!! wikitext |
| 3277 |
<gallery> |
| 3278 |
File:Foobar.jpg|alt=-{R|bat}-|[[File:foobar.jpg|20px|desc|alt=-{R|foo}-|-{R|bar}-]] |
| 3279 |
File:Foobar.jpg|alt=galleryalt|{{Test|unamedParam|alt=-{R|param}-}} |
| 3280 |
</gallery> |
| 3281 |
!! html/php |
| 3282 |
<ul class="gallery mw-gallery-traditional"> |
| 3283 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 3284 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="bat" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 3285 |
<div class="gallerytext"><a href="/wiki/File:Foobar.jpg" class="image" title="bar"><img alt="foo" src="http://example.com/images/thumb/3/3a/Foobar.jpg/20px-Foobar.jpg" decoding="async" width="20" height="2" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/30px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/40px-Foobar.jpg 2x" /></a></div> |
| 3286 |
</div></li> |
| 3287 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 3288 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image" title="This is a test template"><img alt="galleryalt" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 3289 |
<div class="gallerytext">This is a test template</div> |
| 3290 |
</div></li> |
| 3291 |
</ul> |
| 3292 |
!! html/parsoid |
| 3293 |
<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt6" data-mw='{"name":"gallery","attrs":{},"body":{}}'> |
| 3294 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File mw:ExpandedAttrs" data-mw='{"attribs":[["alt",{"html":"alt=<span typeof=\"mw:LanguageVariant\" data-mw-variant='{\"disabled\":{\"t\":\"bat\"}}' data-parsoid='{\"fl\":[\"R\"],\"dsr\":[84,93,null,2]}'></span>","txt":""}]]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img alt="" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div><div class="gallerytext"><span typeof="mw:File mw:ExpandedAttrs" about="#mwt3" data-mw='{"attribs":[["alt",{"html":"alt=<span typeof=\"mw:LanguageVariant\" data-mw-variant='{\"disabled\":{\"t\":\"foo\"}}' data-parsoid='{\"fl\":[\"R\"],\"dsr\":[58,67,null,2]}'></span>","txt":""}]],"caption":"<span typeof=\"mw:LanguageVariant\" data-mw-variant='{\"disabled\":{\"t\":\"bar\"}}' data-parsoid='{\"fl\":[\"R\"],\"dsr\":[68,77,null,2]}'></span>"}'><a href="./File:Foobar.jpg" class="mw-file-description"><img alt="" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/20px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="2" width="20" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/30px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/40px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div></li> |
| 3295 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description" title="This is a test template"><img alt="galleryalt" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div><div class="gallerytext"><span about="#mwt2" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"Test","href":"./Template:Test"},"params":{"1":{"wt":"unamedParam"},"alt":{"wt":"-{R|param}-"}},"i":0}}]}'>This is a test template</span></div></li> |
| 3296 |
</ul> |
| 3297 |
!! end |
| 3298 |
|
| 3299 |
!! test |
| 3300 |
Free external link invading image caption |
| 3301 |
!! config |
| 3302 |
wgParserEnableLegacyMediaDOM=true |
| 3303 |
!! wikitext |
| 3304 |
[[File:Foobar.jpg|thumb|http://x|hello]] |
| 3305 |
!! html/php |
| 3306 |
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>hello</div></div></div> |
| 3307 |
!! html/parsoid |
| 3308 |
<figure class="mw-default-size" typeof="mw:File/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"bogus","ak":"http://x"},{"ck":"caption","ak":"hello"}]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a><figcaption>hello</figcaption></figure> |
| 3309 |
!! end |
| 3310 |
|
| 3311 |
!! test |
| 3312 |
Special characters in embedded file links (T29679) |
| 3313 |
!! config |
| 3314 |
wgParserEnableLegacyMediaDOM=true |
| 3315 |
!! wikitext |
| 3316 |
[[File:Contains & ampersand.jpg]] |
| 3317 |
[[File:Does not exist.jpg|Title with & ampersand]] |
| 3318 |
!! html/php |
| 3319 |
<p><a href="/index.php?title=Special:Upload&wpDestFile=Contains_%26_ampersand.jpg" class="new" title="File:Contains & ampersand.jpg">File:Contains & ampersand.jpg</a> |
| 3320 |
<a href="/index.php?title=Special:Upload&wpDestFile=Does_not_exist.jpg" class="new" title="File:Does not exist.jpg">Title with & ampersand</a> |
| 3321 |
</p> |
| 3322 |
!! html/parsoid |
| 3323 |
<p><span class="mw-default-size" typeof="mw:Error mw:File" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Contains_&_ampersand.jpg"><span class="mw-file-element mw-broken-media" resource="./File:Contains_&_ampersand.jpg" data-parsoid='{"a":{"resource":"./File:Contains_&_ampersand.jpg"},"sa":{"resource":"File:Contains & ampersand.jpg"}}'>File:Contains & ampersand.jpg</span></a></span> |
| 3324 |
<span class="mw-default-size" typeof="mw:Error mw:File" data-mw='{"caption":"Title with &amp; ampersand","errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Does_not_exist.jpg"><span class="mw-file-element mw-broken-media" resource="./File:Does_not_exist.jpg" data-parsoid='{"a":{"resource":"./File:Does_not_exist.jpg"},"sa":{"resource":"File:Does not exist.jpg"}}'>Title with & ampersand</span></a></span></p> |
| 3325 |
!! end |
| 3326 |
|
| 3327 |
# T65642/T68749: Formatting elt fixup around images. |
| 3328 |
# We know wt2wt will fail, but we expect selser to pass. |
| 3329 |
# Due to the nature of our testing, wt2wt and selser tests will enter the |
| 3330 |
# banned list and we'll catch selser regressions based on changes to the |
| 3331 |
# banned list entries for selser tests. |
| 3332 |
!! test |
| 3333 |
1. Treebuilder fixup of formatting elt |
| 3334 |
!! options |
| 3335 |
parsoid=wt2html,wt2wt |
| 3336 |
!! config |
| 3337 |
wgParserEnableLegacyMediaDOM=true |
| 3338 |
!! wikitext |
| 3339 |
{| |
| 3340 |
| |
| 3341 |
<small> |
| 3342 |
[[Image:Foobar.jpg|right|Test]] |
| 3343 |
</small> |
| 3344 |
|} |
| 3345 |
!! html/php |
| 3346 |
<table> |
| 3347 |
<tbody><tr> |
| 3348 |
<td> |
| 3349 |
<p><small> |
| 3350 |
</small></p><small> |
| 3351 |
<div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Test"><img alt="Test" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a></div> |
| 3352 |
</small><p><small></small> |
| 3353 |
</p> |
| 3354 |
</td></tr></tbody></table> |
| 3355 |
!! html/parsoid |
| 3356 |
<table> |
| 3357 |
<tbody><tr><td> |
| 3358 |
<p><small data-parsoid='{"stx":"html","autoInsertedEnd":true}'></small></p><small data-parsoid='{"stx":"html","autoInsertedEnd":true,"autoInsertedStart":true}'> |
| 3359 |
<figure class="mw-default-size mw-halign-right" typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description" title="Test"><img alt="Test" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a><figcaption>Test</figcaption></figure></small> |
| 3360 |
<p><small data-parsoid='{"stx":"html","autoInsertedStart":true}'></small></p></td></tr> |
| 3361 |
</tbody></table> |
| 3362 |
!! end |
| 3363 |
|
| 3364 |
!! test |
| 3365 |
2. Treebuilder fixup of formatting elt |
| 3366 |
!! options |
| 3367 |
parsoid=wt2html,wt2wt |
| 3368 |
!! config |
| 3369 |
wgParserEnableLegacyMediaDOM=true |
| 3370 |
!! wikitext |
| 3371 |
'''foo[[File:Foobar.jpg|thumb|caption]]bar''' |
| 3372 |
|
| 3373 |
<small>[[Image:Foobar.jpg|right|300px]]</small> |
| 3374 |
!! html/php |
| 3375 |
<p><b>foo</b></p><b><div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>caption</div></div></div></b><p><b>bar</b> |
| 3376 |
</p><small><div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg" decoding="async" width="300" height="34" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/450px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/600px-Foobar.jpg 2x" /></a></div></small> |
| 3377 |
!! html/parsoid |
| 3378 |
<p><b>foo</b></p><b><figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a><figcaption>caption</figcaption></figure></b><p><b>bar</b></p> |
| 3379 |
|
| 3380 |
<small><figure class="mw-halign-right" typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="34" width="300" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/450px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/600px-Foobar.jpg 2x" class="mw-file-element"/></a><figcaption></figcaption></figure></small> |
| 3381 |
!! end |
| 3382 |
|
| 3383 |
!! test |
| 3384 |
3. Treebuilder fixup of formatting elt |
| 3385 |
!! options |
| 3386 |
parsoid=wt2html,wt2wt |
| 3387 |
!! config |
| 3388 |
wgParserEnableLegacyMediaDOM=true |
| 3389 |
!! wikitext |
| 3390 |
<small>'''foo[[File:Foobar.jpg|thumb|caption]]bar'''</small> |
| 3391 |
!! html/php |
| 3392 |
<p><small><b>foo</b></small></p><small><b><div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>caption</div></div></div></b></small><p><small><b>bar</b></small></p> |
| 3393 |
!! html/parsoid |
| 3394 |
<p><small><b>foo</b></small></p><small><b><figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a><figcaption>caption</figcaption></figure></b></small><p><small><b>bar</b></small></p> |
| 3395 |
!! end |
| 3396 |
|
| 3397 |
!! test |
| 3398 |
4. Treebuilder fixup of formatting elt: formatting tags around captionless images |
| 3399 |
!! options |
| 3400 |
parsoid=wt2html,wt2wt |
| 3401 |
!! config |
| 3402 |
wgParserEnableLegacyMediaDOM=true |
| 3403 |
!! wikitext |
| 3404 |
'''<small>[[Image:Foobar.jpg|right|300px]]</small>''' |
| 3405 |
!! html/php |
| 3406 |
<b><small><div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg" decoding="async" width="300" height="34" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/450px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/600px-Foobar.jpg 2x" /></a></div></small></b> |
| 3407 |
!! html/parsoid |
| 3408 |
<b><small><figure class="mw-halign-right" typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="34" width="300" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/450px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/600px-Foobar.jpg 2x" class="mw-file-element"/></a><figcaption></figcaption></figure></small></b> |
| 3409 |
!! end |
| 3410 |
|
| 3411 |
!! test |
| 3412 |
Image: Modifying size of an image (1) |
| 3413 |
!! options |
| 3414 |
parsoid={ |
| 3415 |
"modes": ["wt2wt"], |
| 3416 |
"changes": [ |
| 3417 |
["img[height]", "attr", "height", "22"], |
| 3418 |
["img[width]", "attr", "width", "200"] |
| 3419 |
] |
| 3420 |
} |
| 3421 |
!! wikitext |
| 3422 |
[[Image:Foobar.jpg|230x230px]] |
| 3423 |
!! wikitext/edited |
| 3424 |
[[Image:Foobar.jpg|200x200px]] |
| 3425 |
!!end |
| 3426 |
|
| 3427 |
!! test |
| 3428 |
Image: Modifying size of an image (2) |
| 3429 |
!! options |
| 3430 |
parsoid={ |
| 3431 |
"modes": ["wt2wt"], |
| 3432 |
"changes": [ |
| 3433 |
["img[height]", "attr", "height", "100"], |
| 3434 |
["img[width]", "attr", "width", "500"] |
| 3435 |
] |
| 3436 |
} |
| 3437 |
!! wikitext |
| 3438 |
[[Image:Foobar.jpg|230x230px]] |
| 3439 |
!! wikitext/edited |
| 3440 |
[[Image:Foobar.jpg|500x500px]] |
| 3441 |
!!end |
| 3442 |
|
| 3443 |
# Change in size is ignored so long as class='mw-default-size' |
| 3444 |
!! test |
| 3445 |
Image: Modifying size of an image (3) |
| 3446 |
!! options |
| 3447 |
parsoid={ |
| 3448 |
"modes": ["wt2wt"], |
| 3449 |
"changes": [ |
| 3450 |
["figure[class]", "removeClass", "mw-default-size"], |
| 3451 |
["figure img", "attr", "height", "19"], |
| 3452 |
["figure img", "attr", "width", "170"] |
| 3453 |
] |
| 3454 |
} |
| 3455 |
!! wikitext |
| 3456 |
[[Image:Foobar.jpg|thumb]] |
| 3457 |
!! wikitext/edited |
| 3458 |
[[Image:Foobar.jpg|thumb|170x170px]] |
| 3459 |
!!end |
| 3460 |
|
| 3461 |
!! test |
| 3462 |
Image: Modifying alignment of an image (T50665) |
| 3463 |
!! options |
| 3464 |
parsoid={ |
| 3465 |
"modes": ["wt2wt"], |
| 3466 |
"changes": [ |
| 3467 |
["figure[class]", "removeClass", "mw-halign-right"], |
| 3468 |
["figure[class]", "addClass", "mw-halign-left"] |
| 3469 |
] |
| 3470 |
} |
| 3471 |
!! wikitext |
| 3472 |
[[Image:Foobar.jpg|thumb|caption|right]] |
| 3473 |
!! wikitext/edited |
| 3474 |
[[Image:Foobar.jpg|thumb|caption|left]] |
| 3475 |
!! end |
| 3476 |
|
| 3477 |
!! test |
| 3478 |
Image: Modifying mw-default-size of an frameless image (T64805) |
| 3479 |
!! options |
| 3480 |
parsoid={ |
| 3481 |
"modes": ["wt2wt"], |
| 3482 |
"changes": [ |
| 3483 |
["figure.mw-default-size", "removeClass", "mw-default-size"] |
| 3484 |
] |
| 3485 |
} |
| 3486 |
!! wikitext |
| 3487 |
[[Image:Foobar.jpg|frameless|right]] |
| 3488 |
!! wikitext/edited |
| 3489 |
[[Image:Foobar.jpg|frameless|right|180x180px]] |
| 3490 |
!! end |
| 3491 |
|
| 3492 |
!! test |
| 3493 |
Image: Modifying valign of an image (T51221) |
| 3494 |
!! options |
| 3495 |
parsoid={ |
| 3496 |
"modes": ["wt2wt"], |
| 3497 |
"changes": [ |
| 3498 |
["*[typeof=\"mw:File\"]", "removeClass", "mw-valign-middle"], |
| 3499 |
["*[typeof=\"mw:File\"]", "addClass", "mw-valign-text-top"] |
| 3500 |
] |
| 3501 |
} |
| 3502 |
!! wikitext |
| 3503 |
[[File:Foobar.jpg|20px|middle]] |
| 3504 |
!! wikitext/edited |
| 3505 |
[[File:Foobar.jpg|20px|text-top]] |
| 3506 |
!! end |
| 3507 |
|
| 3508 |
!! test |
| 3509 |
Image: Modifying alt attribute of an image (T58400) |
| 3510 |
!! options |
| 3511 |
disabled |
| 3512 |
parsoid={ |
| 3513 |
"modes": ["wt2wt"], |
| 3514 |
"changes": [ |
| 3515 |
["img[alt]", "attr", "alt", "some alternate edited text"] |
| 3516 |
] |
| 3517 |
} |
| 3518 |
!! wikitext |
| 3519 |
[[File:Foobar.jpg|thumb|some caption|alt=some alternate text]] |
| 3520 |
!! wikitext/edited |
| 3521 |
[[File:Foobar.jpg|thumb|some caption|alt=some alternate edited text]] |
| 3522 |
!!end |
| 3523 |
|
| 3524 |
!! test |
| 3525 |
Image: Modifying caption of an image |
| 3526 |
!! options |
| 3527 |
parsoid={ |
| 3528 |
"modes": ["wt2wt"], |
| 3529 |
"changes": [ |
| 3530 |
["figcaption", "text", "new caption"] |
| 3531 |
] |
| 3532 |
} |
| 3533 |
!! wikitext |
| 3534 |
[[Image:Foobar.jpg|thumb|original caption]] |
| 3535 |
!! wikitext/edited |
| 3536 |
[[Image:Foobar.jpg|thumb|new caption]] |
| 3537 |
!!end |
| 3538 |
|
| 3539 |
!! test |
| 3540 |
Image: empty alt attribute (T50924) |
| 3541 |
!! config |
| 3542 |
wgParserEnableLegacyMediaDOM=true |
| 3543 |
!! wikitext |
| 3544 |
[[File:Foobar.jpg|alt=|thumb|bar]] |
| 3545 |
!! html/php |
| 3546 |
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>bar</div></div></div> |
| 3547 |
!! html/parsoid |
| 3548 |
<figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img alt="" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a><figcaption>bar</figcaption></figure> |
| 3549 |
!! end |
| 3550 |
|
| 3551 |
!! test |
| 3552 |
Image: new attributes should be serialized in wiki's language for RTL languages (T53852) |
| 3553 |
!! options |
| 3554 |
parsoid=html2wt |
| 3555 |
language=ar |
| 3556 |
disabled |
| 3557 |
!! html/parsoid |
| 3558 |
<figure class="mw-default-size mw-halign-right" typeof="mw:File/Thumb"><a href="./Imagen:Foobar.jpg"><img resource="./Imagen:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180"/></a></figure> |
| 3559 |
!! wikitext |
| 3560 |
[[Imagen:Foobar.jpg|derecha|miniaturadeimagen]] |
| 3561 |
!! end |
| 3562 |
|
| 3563 |
!! test |
| 3564 |
Image: Block level image should have \n before and after |
| 3565 |
!! wikitext |
| 3566 |
123 |
| 3567 |
[[File:Foobar.jpg|right|thumb|150x150px]] |
| 3568 |
456 |
| 3569 |
!! html/parsoid |
| 3570 |
<p>123</p> |
| 3571 |
<figure class="mw-halign-right" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/150px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="17" width="150" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/225px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg 2x" class="mw-file-element"/></a><figcaption></figcaption></figure> |
| 3572 |
<p>456</p> |
| 3573 |
!! end |
| 3574 |
|
| 3575 |
!! test |
| 3576 |
Image: New block level image should have \n before and after (existing content) |
| 3577 |
!! wikitext |
| 3578 |
123 |
| 3579 |
[[File:Foobar.jpg|right|thumb|150x150px]] |
| 3580 |
456 |
| 3581 |
!! html/parsoid |
| 3582 |
<p>123</p> |
| 3583 |
<figure class="mw-halign-right" typeof="mw:File/Thumb" data-parsoid='{"optList":[{"ck":"right","ak":"right"},{"ck":"thumbnail","ak":"thumb"},{"ck":"width","ak":"150x150px"}]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/150px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="17" width="150" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/225px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg 2x" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"17","width":"150"},"sa":{"resource":"File:Foobar.jpg"}}' class="mw-file-element"/></a><figcaption></figcaption></figure> |
| 3584 |
<p>456</p> |
| 3585 |
!! end |
| 3586 |
|
| 3587 |
!! test |
| 3588 |
Image: upright option (parsoid) |
| 3589 |
!! wikitext |
| 3590 |
[[File:Foobar.jpg|thumb|upright|caption]] |
| 3591 |
[[File:Foobar.jpg|thumb|upright=0.5|caption]] |
| 3592 |
[[File:Foobar.jpg|thumb|500x500px|upright=0.5|caption]] |
| 3593 |
!! html/parsoid |
| 3594 |
<figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/140px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="16" width="140" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/210px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/280px-Foobar.jpg 2x" class="mw-file-element"/></a><figcaption>caption</figcaption></figure> |
| 3595 |
<figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/90px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="10" width="90" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/135px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 2x" class="mw-file-element"/></a><figcaption>caption</figcaption></figure> |
| 3596 |
<figure typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/500px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="57" width="500" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/750px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/1000px-Foobar.jpg 2x" class="mw-file-element"/></a><figcaption>caption</figcaption></figure> |
| 3597 |
!! end |
| 3598 |
|
| 3599 |
!! test |
| 3600 |
Image: upright option is ignored on inline and frame images (parsoid) |
| 3601 |
!! wikitext |
| 3602 |
[[File:Foobar.jpg|500x500px|upright=0.5|caption]] |
| 3603 |
!! html/parsoid |
| 3604 |
<p><span typeof="mw:File" data-mw='{"caption":"caption"}'><a href="./File:Foobar.jpg" class="mw-file-description" title="caption"><img alt="caption" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/500px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="57" width="500" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/750px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/1000px-Foobar.jpg 2x" class="mw-file-element"/></a></span></p> |
| 3605 |
!! end |
| 3606 |
|
| 3607 |
!! test |
| 3608 |
Image: in template parameter with empty parameter |
| 3609 |
!! wikitext |
| 3610 |
{{1x|[[File:Foobar.jpg|link=]]}} |
| 3611 |
!! html/parsoid |
| 3612 |
<p><span class="mw-default-size" typeof="mw:Transclusion mw:File" about="#mwt1" data-mw='{"parts":[{"template":{"target":{"wt":"1x","href":"./Template:1x"},"params":{"1":{"wt":"[[File:Foobar.jpg|link=]]"}},"i":0}}]}'><span><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></span></span></p> |
| 3613 |
!! end |
| 3614 |
|
| 3615 |
!! test |
| 3616 |
Image: from basic HTML (1) |
| 3617 |
!! options |
| 3618 |
parsoid=html2wt |
| 3619 |
!! html/parsoid |
| 3620 |
<span typeof="mw:File"> |
| 3621 |
<img src="./File:Foobar.jpg" width=100 height=100 alt="Alt"> |
| 3622 |
</span> |
| 3623 |
!! wikitext |
| 3624 |
[[File:Foobar.jpg|link=|alt=Alt|100x100px]] |
| 3625 |
!! end |
| 3626 |
|
| 3627 |
!! test |
| 3628 |
Image: from basic HTML (2) |
| 3629 |
!! options |
| 3630 |
parsoid=html2wt |
| 3631 |
!! html/parsoid |
| 3632 |
<img src="./File:Foobar.jpg" width=100 height=100 alt="Alt"> |
| 3633 |
!! wikitext |
| 3634 |
[[File:Foobar.jpg|link=|alt=Alt|100x100px]] |
| 3635 |
!! end |
| 3636 |
|
| 3637 |
!! test |
| 3638 |
Image: from basic HTML (3) |
| 3639 |
!! options |
| 3640 |
parsoid=html2wt |
| 3641 |
!! html/parsoid |
| 3642 |
<a href="Main"><img src="./File:Foobar.jpg" width=100 height=100 alt="Alt"></a> |
| 3643 |
!! wikitext |
| 3644 |
[[File:Foobar.jpg|link=Main|alt=Alt|100x100px]] |
| 3645 |
!! end |
| 3646 |
|
| 3647 |
!! test |
| 3648 |
Image: from basic HTML (4) |
| 3649 |
!! options |
| 3650 |
parsoid=html2wt |
| 3651 |
!! html/parsoid |
| 3652 |
<img src="./File:Foobar.jpg"> |
| 3653 |
!! wikitext |
| 3654 |
[[File:Foobar.jpg|link=]] |
| 3655 |
!! end |
| 3656 |
|
| 3657 |
!! test |
| 3658 |
Image: Invalid title as link |
| 3659 |
!! config |
| 3660 |
wgParserEnableLegacyMediaDOM=true |
| 3661 |
!! wikitext |
| 3662 |
[[File:Foobar.jpg|link=<]] |
| 3663 |
!! html/php |
| 3664 |
<p><a href="/wiki/File:Foobar.jpg" class="image" title="link=<"><img alt="link=<" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 3665 |
</p> |
| 3666 |
!! html/parsoid |
| 3667 |
<p><span class="mw-default-size" typeof="mw:File" data-parsoid='{"optList":[{"ck":"link","ak":"link=<"}]}' data-mw='{"attribs":[["link",{"txt":"<"}]]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a></span></p> |
| 3668 |
!! end |
| 3669 |
|
| 3670 |
!! article |
| 3671 |
Test"123 |
| 3672 |
!! text |
| 3673 |
Dummy article to suppress redlinks in tests |
| 3674 |
!! end |
| 3675 |
|
| 3676 |
## Roundtripping the gallery here without normalization needs T252246 / T252246 |
| 3677 |
!! test |
| 3678 |
Percent decode titles in the link option (T216003#7836261) |
| 3679 |
!! options |
| 3680 |
parsoid=wt2html,html2html |
| 3681 |
!! config |
| 3682 |
wgParserEnableLegacyMediaDOM=true |
| 3683 |
!! wikitext |
| 3684 |
[[Test%22123]] |
| 3685 |
[[File:Foobar.jpg|link=Test%22123]] |
| 3686 |
[[File:Foobar.jpg|link=[[Test%22123]]]] |
| 3687 |
|
| 3688 |
<gallery> |
| 3689 |
File:Foobar.jpg|link=Test%22123 |
| 3690 |
File:Foobar.jpg|link=[[Test%22123]] |
| 3691 |
</gallery> |
| 3692 |
!! html/php |
| 3693 |
<p><a href="/wiki/Test%22123" title="Test"123">Test"123</a> |
| 3694 |
<a href="/wiki/Test%22123" title="Test"123"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 3695 |
<a href="/wiki/Test%22123" title="Test"123"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 3696 |
</p> |
| 3697 |
<ul class="gallery mw-gallery-traditional"> |
| 3698 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 3699 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/Test%22123" title="Test"123"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 3700 |
<div class="gallerytext"></div> |
| 3701 |
</div></li> |
| 3702 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 3703 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/Test%22123" title="Test"123"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div> |
| 3704 |
<div class="gallerytext"></div> |
| 3705 |
</div></li> |
| 3706 |
</ul> |
| 3707 |
!! html/parsoid |
| 3708 |
<p><a rel="mw:WikiLink" href='./Test"123' title='Test"123' data-parsoid='{"stx":"simple","a":{"href":"./Test\"123"},"sa":{"href":"Test%22123"}}'>Test"123</a> |
| 3709 |
<span class="mw-default-size" typeof="mw:File" data-parsoid='{"optList":[{"ck":"link","ak":"link=Test%22123"}]}'><a href='./Test"123' title='Test"123'><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"220","width":"1941"},"sa":{"resource":"File:Foobar.jpg"}}' class="mw-file-element"/></a></span> |
| 3710 |
<span class="mw-default-size" typeof="mw:File" data-parsoid='{"optList":[{"ck":"link","ak":"link=[[Test%22123]]"}]}'><a href='./Test"123' title='Test"123'><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"220","width":"1941"},"sa":{"resource":"File:Foobar.jpg"}}' class="mw-file-element"/></a></span></p> |
| 3711 |
|
| 3712 |
<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt3" data-mw='{"name":"gallery","attrs":{},"body":{}}'> |
| 3713 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File" data-parsoid='{"optList":[{"ck":"width","ak":"120x120px"},{"ck":"link","ak":"link=Test%22123"}]}'><a href='./Test"123' title='Test"123'><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"14","width":"120"},"sa":{"resource":"File:Foobar.jpg"}}' class="mw-file-element"/></a></span></div><div class="gallerytext"></div></li> |
| 3714 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File" data-parsoid='{"optList":[{"ck":"width","ak":"120x120px"},{"ck":"link","ak":"link=[[Test%22123]]"}]}'><a href='./Test"123' title='Test"123'><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"14","width":"120"},"sa":{"resource":"File:Foobar.jpg"}}' class="mw-file-element"/></a></span></div><div class="gallerytext"></div></li> |
| 3715 |
</ul> |
| 3716 |
!! end |
| 3717 |
|
| 3718 |
!! test |
| 3719 |
Various link types in alt and link options |
| 3720 |
!! config |
| 3721 |
wgParserEnableLegacyMediaDOM=true |
| 3722 |
!! wikitext |
| 3723 |
[[File:Foobar.jpg|link=[[Main Page]]|alt=[[Main Page]]|caption]] |
| 3724 |
|
| 3725 |
[[File:Foobar.jpg|link=[[Media:Thumb.png]]|alt=[[Media:Thumb.png]]|caption]] |
| 3726 |
|
| 3727 |
[[File:Foobar.jpg|link=[[wikipedia:Foo]]|alt=[[wikipedia:Foo]]|caption]] |
| 3728 |
!! html/php |
| 3729 |
<p><a href="/wiki/Main_Page" title="caption"><img alt="Main Page" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 3730 |
</p><p><a href="/wiki/Media:Thumb.png" title="caption"><img alt="Media:Thumb.png" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 3731 |
</p><p><a href="http://en.wikipedia.org/wiki/Foo" title="caption"><img alt="wikipedia:Foo" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 3732 |
</p> |
| 3733 |
!! html/parsoid |
| 3734 |
<p><span class="mw-default-size" typeof="mw:File mw:ExpandedAttrs" about="#mwt1" data-mw='{"attribs":[["alt",{"html":"alt=<a rel=\"mw:WikiLink\" href=\"./Main_Page\" title=\"Main Page\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"./Main_Page\"},\"sa\":{\"href\":\"Main Page\"},\"dsr\":[41,216,2,2]}'>Main Page</a>","txt":"Main Page"}]],"caption":"caption"}'><a href="./Main_Page" title="caption" data-parsoid='{"a":{"href":"./Main_Page"},"sa":{"href":"link=[[Main Page]]"}}'><img alt="Main Page" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a></span></p> |
| 3735 |
|
| 3736 |
<p><span class="mw-default-size" typeof="mw:File mw:ExpandedAttrs" about="#mwt3" data-mw='{"attribs":[["alt",{"html":"alt=<a rel=\"mw:MediaLink\" href=\"http://example.com/images/e/ea/Thumb.png\" resource=\"./Media:Thumb.png\" title=\"Thumb.png\" data-parsoid='{\"a\":{\"resource\":\"./Media:Thumb.png\"},\"sa\":{\"resource\":\"Media:Thumb.png\"},\"dsr\":[113,216,null,null]}'>Media:Thumb.png</a>","txt":"Media:Thumb.png"}]],"caption":"caption"}'><a href="./Media:Thumb.png" title="caption" data-parsoid='{"a":{"href":"./Media:Thumb.png"},"sa":{"href":"link=[[Media:Thumb.png]]"}}'><img alt="Media:Thumb.png" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a></span></p> |
| 3737 |
|
| 3738 |
<p><span class="mw-default-size" typeof="mw:File mw:ExpandedAttrs" about="#mwt2" data-mw='{"attribs":[["alt",{"html":"alt=<a rel=\"mw:WikiLink/Interwiki\" href=\"http://en.wikipedia.org/wiki/Foo\" title=\"wikipedia:Foo\" class=\"extiw\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"http://en.wikipedia.org/wiki/Foo\"},\"sa\":{\"href\":\"wikipedia:Foo\"},\"isIW\":true,\"dsr\":[189,216,2,2]}'>wikipedia:Foo</a>","txt":"wikipedia:Foo"}]],"caption":"caption"}'><a href="http://en.wikipedia.org/wiki/Foo" title="caption" data-parsoid='{"a":{"href":"http://en.wikipedia.org/wiki/Foo"},"sa":{"href":"link=[[wikipedia:Foo]]"}}'><img alt="wikipedia:Foo" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a></span></p> |
| 3739 |
!! end |
| 3740 |
|
| 3741 |
!! test |
| 3742 |
Magic links inside image captions (autolinked) |
| 3743 |
!! config |
| 3744 |
wgParserEnableLegacyMediaDOM=true |
| 3745 |
!! wikitext |
| 3746 |
[[File:Foobar.jpg|thumb|http://example.com]] |
| 3747 |
[[File:Foobar.jpg|thumb|RFC 1234]] |
| 3748 |
[[File:Foobar.jpg|thumb|PMID 1234]] |
| 3749 |
[[File:Foobar.jpg|thumb|ISBN 123456789x]] |
| 3750 |
!! html/php |
| 3751 |
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a></div></div></div> |
| 3752 |
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div><a class="external mw-magiclink-rfc" rel="nofollow" href="https://datatracker.ietf.org/doc/html/rfc1234">RFC 1234</a></div></div></div> |
| 3753 |
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div><a class="external mw-magiclink-pmid" rel="nofollow" href="//www.ncbi.nlm.nih.gov/pubmed/1234?dopt=Abstract">PMID 1234</a></div></div></div> |
| 3754 |
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div><a href="/wiki/Special:BookSources/123456789X" class="internal mw-magiclink-isbn">ISBN 123456789x</a></div></div></div> |
| 3755 |
!! html/parsoid |
| 3756 |
<figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a><figcaption><a rel="mw:ExtLink" href="http://example.com" class="external free">http://example.com</a></figcaption></figure> |
| 3757 |
<figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a><figcaption><a href="https://datatracker.ietf.org/doc/html/rfc1234" rel="mw:ExtLink" class="external mw-magiclink">RFC 1234</a></figcaption></figure> |
| 3758 |
<figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a><figcaption><a href="//www.ncbi.nlm.nih.gov/pubmed/1234?dopt=Abstract" rel="mw:ExtLink" class="external mw-magiclink">PMID 1234</a></figcaption></figure> |
| 3759 |
<figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a><figcaption><a href="./Special:BookSources/123456789X" rel="mw:WikiLink">ISBN 123456789x</a></figcaption></figure> |
| 3760 |
!! end |
| 3761 |
|
| 3762 |
## FIXME: Parsoid isn't recognizing an Interwiki here in standalone mode |
| 3763 |
!! test |
| 3764 |
Interwiki links inside image captions |
| 3765 |
!! options |
| 3766 |
language=de |
| 3767 |
!! config |
| 3768 |
wgParserEnableLegacyMediaDOM=true |
| 3769 |
!! wikitext |
| 3770 |
[[File:Foobar.jpg|thumb|right|[[:Wikipedia:Foo]] bar]] |
| 3771 |
!! html/php |
| 3772 |
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/Datei:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/Datei:Foobar.jpg" class="internal" title="vergrößern"></a></div><a href="http://en.wikipedia.org/wiki/Foo" class="extiw" title="wikipedia:Foo">Wikipedia:Foo</a> bar</div></div></div> |
| 3773 |
!! html/parsoid+standalone |
| 3774 |
<figure class="mw-default-size mw-halign-right" typeof="mw:File/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"right","ak":"right"},{"ck":"caption","ak":"[[:Wikipedia:Foo]] bar"}]}'><a href="./Datei:Foobar.jpg" class="mw-file-description"><img resource="./Datei:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" data-parsoid='{"a":{"resource":"./Datei:Foobar.jpg","height":"20","width":"180"},"sa":{"resource":"File:Foobar.jpg"}}' class="mw-file-element"/></a><figcaption><a rel="mw:WikiLink" href="./Wikipedia:Foo?action=edit&redlink=1" title="Wikipedia:Foo" class="new" typeof="mw:LocalizedAttrs" data-parsoid='{"stx":"simple","a":{"href":"./Wikipedia:Foo"},"sa":{"href":":Wikipedia:Foo"}}' data-mw-i18n='{"title":{"lang":"x-page","key":"red-link-title","params":["Wikipedia:Foo"]}}'>Wikipedia:Foo</a> bar</figcaption></figure> |
| 3775 |
!! html/parsoid+integrated |
| 3776 |
<figure class="mw-default-size mw-halign-right" typeof="mw:File/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"right","ak":"right"},{"ck":"caption","ak":"[[:Wikipedia:Foo]] bar"}]}'><a href="./Datei:Foobar.jpg" class="mw-file-description"><img resource="./Datei:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" data-parsoid='{"a":{"resource":"./Datei:Foobar.jpg","height":"20","width":"180"},"sa":{"resource":"File:Foobar.jpg"}}' class="mw-file-element"/></a><figcaption><a rel="mw:WikiLink/Interwiki" href="http://en.wikipedia.org/wiki/Foo" title="wikipedia:Foo" class="extiw">Wikipedia:Foo</a> bar</figcaption></figure> |
| 3777 |
!! end |
| 3778 |
|
| 3779 |
## Don't necessarily expect this to roundtrip, but run serialization to catch crashers |
| 3780 |
!! test |
| 3781 |
File in link scenarios |
| 3782 |
!! options |
| 3783 |
parsoid={ |
| 3784 |
"modes": ["wt2html","html2wt"], |
| 3785 |
"suppressErrors": true |
| 3786 |
} |
| 3787 |
!! config |
| 3788 |
wgParserEnableLegacyMediaDOM=true |
| 3789 |
!! wikitext |
| 3790 |
[http://www.google.com [[File:Foobar.jpg|123]]] |
| 3791 |
|
| 3792 |
[http://www.google.com [[File:Foobar.jpg|thumb|123]]] |
| 3793 |
!! html/php |
| 3794 |
<p><a rel="nofollow" class="external text" href="http://www.google.com"></a><a href="/wiki/File:Foobar.jpg" class="image" title="123"><img alt="123" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 3795 |
</p> |
| 3796 |
<a rel="nofollow" class="external text" href="http://www.google.com"></a><div class="thumb tright"><a rel="nofollow" class="external text" href="http://www.google.com"></a><div class="thumbinner" style="width:182px;"><a rel="nofollow" class="external text" href="http://www.google.com"></a><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>123</div></div></div> |
| 3797 |
!! html/parsoid |
| 3798 |
<p><a rel="mw:ExtLink" href="http://www.google.com" class="external text"><span class="mw-default-size" typeof="mw:File" data-parsoid='{"optList":[{"ck":"caption","ak":"123"}]}' data-mw='{"caption":"123"}'></span></a><a href="./File:Foobar.jpg" class="mw-file-description" title="123" data-parsoid='{"misnested":true}'><img alt="123" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"220","width":"1941"},"sa":{"resource":"File:Foobar.jpg"},"misnested":true}' class="mw-file-element"/></a></p> |
| 3799 |
|
| 3800 |
<a rel="mw:ExtLink" href="http://www.google.com" class="external autonumber"></a><figure class="mw-default-size" typeof="mw:File/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"caption","ak":"123"}]}'><a rel="mw:ExtLink" href="http://www.google.com" class="external autonumber"></a><a href="./File:Foobar.jpg" class="mw-file-description" data-parsoid='{"misnested":true}'><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"20","width":"180"},"sa":{"resource":"File:Foobar.jpg"},"misnested":true}' class="mw-file-element"/></a><figcaption data-parsoid='{"misnested":true}'>123</figcaption></figure> |
| 3801 |
!! end |
| 3802 |
|
| 3803 |
!! test |
| 3804 |
Thumbnail output |
| 3805 |
!! config |
| 3806 |
wgParserEnableLegacyMediaDOM=true |
| 3807 |
!! wikitext |
| 3808 |
[[File:Thumb.png|thumb]] |
| 3809 |
!! html/php |
| 3810 |
<div class="thumb tright"><div class="thumbinner" style="width:137px;"><a href="/wiki/File:Thumb.png" class="image"><img alt="Thumb.png" src="http://example.com/images/e/ea/Thumb.png" decoding="async" width="135" height="135" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Thumb.png" class="internal" title="Enlarge"></a></div></div></div></div> |
| 3811 |
!! html/parsoid |
| 3812 |
<figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Thumb.png" class="mw-file-description"><img resource="./File:Thumb.png" src="http://example.com/images/e/ea/Thumb.png" decoding="async" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135" class="mw-file-element"/></a><figcaption></figcaption></figure> |
| 3813 |
!! end |
| 3814 |
|
| 3815 |
## The bogus option here isn't going to roundtrip |
| 3816 |
!! test |
| 3817 |
File with caption with pipe in extension tag attribute |
| 3818 |
!! options |
| 3819 |
parsoid=wt2html,html2html |
| 3820 |
!! config |
| 3821 |
wgParserEnableLegacyMediaDOM=true |
| 3822 |
!! wikitext |
| 3823 |
[[File:Foobar.jpg|thumb|Test <nowiki bogus="attri|bute"/> 123]] |
| 3824 |
!! html/php |
| 3825 |
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>Test 123</div></div></div> |
| 3826 |
!! html/parsoid |
| 3827 |
<figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a><figcaption>Test <span typeof="mw:Nowiki"></span> 123</figcaption></figure> |
| 3828 |
!! end |
| 3829 |
|
| 3830 |
!! test |
| 3831 |
File with table in caption with extra table attribute spaces |
| 3832 |
!! config |
| 3833 |
wgParserEnableLegacyMediaDOM=true |
| 3834 |
!! wikitext |
| 3835 |
[[File:Foobar.jpg|thumb| |
| 3836 |
{| |
| 3837 |
|- |
| 3838 |
|hi |
| 3839 |
|} |
| 3840 |
]] |
| 3841 |
!! html/php |
| 3842 |
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" 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> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div> <table> <tbody><tr> <td>hi </td></tr></tbody></table> </div></div></div> |
| 3843 |
!! html/parsoid |
| 3844 |
<figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" 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" class="mw-file-element"/></a><figcaption> |
| 3845 |
<table> |
| 3846 |
<tbody><tr data-parsoid='{"startTagSrc":"|-"}'> |
| 3847 |
<td>hi</td></tr> |
| 3848 |
</tbody></table> |
| 3849 |
</figcaption></figure> |
| 3850 |
!! end |
| 3851 |
|
| 3852 |
## Parsoid uses the alt as the link text, legacy parser uses the caption |
| 3853 |
!! test |
| 3854 |
Broken inline media with a caption and an alt |
| 3855 |
!! config |
| 3856 |
wgParserEnableLegacyMediaDOM=true |
| 3857 |
!! wikitext |
| 3858 |
[[File:Broken.jpg|alt=An alternative text description.|A caption for the media.]] |
| 3859 |
!! html/php |
| 3860 |
<p><a href="/index.php?title=Special:Upload&wpDestFile=Broken.jpg" class="new" title="File:Broken.jpg">A caption for the media.</a> |
| 3861 |
</p> |
| 3862 |
!! html/parsoid |
| 3863 |
<p><span class="mw-default-size" typeof="mw:Error mw:File" data-mw='{"attribs":[["alt",{"txt":"An alternative text description."}]],"caption":"A caption for the media.","errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Broken.jpg"><span class="mw-file-element mw-broken-media" resource="./File:Broken.jpg">An alternative text description.</span></a></span></p> |
| 3864 |
!! end |
| 3865 |
|
| 3866 |
## Parsoid uses the alt as the link text, legacy parser doesn't use either |
| 3867 |
!! test |
| 3868 |
Broken block media with a caption and an alt |
| 3869 |
!! config |
| 3870 |
wgParserEnableLegacyMediaDOM=true |
| 3871 |
!! wikitext |
| 3872 |
[[File:Broken.jpg|alt=An alternative text description.|thumb|A caption for the media.]] |
| 3873 |
!! html/php |
| 3874 |
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/index.php?title=Special:Upload&wpDestFile=Broken.jpg" class="new" title="File:Broken.jpg">File:Broken.jpg</a> <div class="thumbcaption">A caption for the media.</div></div></div> |
| 3875 |
!! html/parsoid |
| 3876 |
<figure class="mw-default-size" typeof="mw:Error mw:File/Thumb" data-mw='{"attribs":[["alt",{"txt":"An alternative text description."}]],"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Broken.jpg"><span class="mw-file-element mw-broken-media" resource="./File:Broken.jpg" data-width="180">An alternative text description.</span></a><figcaption>A caption for the media.</figcaption></figure> |
| 3877 |
!! end |
| 3878 |
|
| 3879 |
## Caption set as the link text, similar to alt on images |
| 3880 |
!! test |
| 3881 |
Broken inline media with a caption |
| 3882 |
!! config |
| 3883 |
wgParserEnableLegacyMediaDOM=true |
| 3884 |
!! wikitext |
| 3885 |
[[File:Broken.jpg|A caption for the media.]] |
| 3886 |
!! html/php |
| 3887 |
<p><a href="/index.php?title=Special:Upload&wpDestFile=Broken.jpg" class="new" title="File:Broken.jpg">A caption for the media.</a> |
| 3888 |
</p> |
| 3889 |
!! html/parsoid |
| 3890 |
<p><span class="mw-default-size" typeof="mw:Error mw:File" data-mw='{"caption":"A caption for the media.","errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Broken.jpg"><span class="mw-file-element mw-broken-media" resource="./File:Broken.jpg">A caption for the media.</span></a></span></p> |
| 3891 |
!! end |
| 3892 |
|
| 3893 |
## Neither implementation uses the caption as link text since it's already visible in the figcaption/thumbcaption, similar to alt on images |
| 3894 |
!! test |
| 3895 |
Broken block media with a caption |
| 3896 |
!! config |
| 3897 |
wgParserEnableLegacyMediaDOM=true |
| 3898 |
!! wikitext |
| 3899 |
[[File:Broken.jpg|thumb|A caption for the media.]] |
| 3900 |
!! html/php |
| 3901 |
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/index.php?title=Special:Upload&wpDestFile=Broken.jpg" class="new" title="File:Broken.jpg">File:Broken.jpg</a> <div class="thumbcaption">A caption for the media.</div></div></div> |
| 3902 |
!! html/parsoid |
| 3903 |
<figure class="mw-default-size" typeof="mw:Error mw:File/Thumb" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Broken.jpg"><span class="mw-file-element mw-broken-media" resource="./File:Broken.jpg" data-width="180">File:Broken.jpg</span></a><figcaption>A caption for the media.</figcaption></figure> |
| 3904 |
!! end |
| 3905 |
|
| 3906 |
!! test |
| 3907 |
Collect media metadata |
| 3908 |
!! config |
| 3909 |
wgParserEnableLegacyMediaDOM=true |
| 3910 |
!! options |
| 3911 |
showmedia |
| 3912 |
!! wikitext |
| 3913 |
[[File:Foobar.jpg|123]] |
| 3914 |
!! metadata |
| 3915 |
images=Foobar.jpg |
| 3916 |
!! html/parsoid |
| 3917 |
<p><span class="mw-default-size" typeof="mw:File" data-mw='{"caption":"123"}'><a href="./File:Foobar.jpg" class="mw-file-description" title="123"><img alt="123" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a></span></p> |
| 3918 |
!! html/php |
| 3919 |
<p><a href="/wiki/File:Foobar.jpg" class="image" title="123"><img alt="123" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 3920 |
</p> |
| 3921 |
!! end |
| 3922 |
|
| 3923 |
# Parsoid currently includes the fragment in the resource attribute, but |
| 3924 |
# this may change in the future: T374893 |
| 3925 |
!! test |
| 3926 |
Fragment in media filename |
| 3927 |
!! config |
| 3928 |
wgParserEnableLegacyMediaDOM=true |
| 3929 |
!! options |
| 3930 |
showmedia |
| 3931 |
!! wikitext |
| 3932 |
[[File:Foobar.jpg#fragment|123]] |
| 3933 |
!! metadata |
| 3934 |
images=Foobar.jpg |
| 3935 |
!! html/parsoid |
| 3936 |
<p><span class="mw-default-size" typeof="mw:File" data-mw='{"caption":"123"}'><a href="./File:Foobar.jpg" class="mw-file-description" title="123"><img alt="123" resource="./File:Foobar.jpg#fragment" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></a></span></p> |
| 3937 |
!! html/php |
| 3938 |
<p><a href="/wiki/File:Foobar.jpg" class="image" title="123"><img alt="123" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a> |
| 3939 |
</p> |
| 3940 |
!! end |
| 3941 |
|
| 3942 |
!! test |
| 3943 |
Entities in media filenames |
| 3944 |
!! config |
| 3945 |
wgParserEnableLegacyMediaDOM=true |
| 3946 |
!! options |
| 3947 |
showmedia |
| 3948 |
!! wikitext |
| 3949 |
[[File:Hi-ho.jpg|thumb]] |
| 3950 |
|
| 3951 |
<gallery> |
| 3952 |
Hi-ho.jpg |
| 3953 |
File:Hi-ho.jpg |
| 3954 |
</gallery> |
| 3955 |
!! metadata |
| 3956 |
images=Hi-ho.jpg |
| 3957 |
!! html/php |
| 3958 |
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Hi-ho.jpg" class="image"><img alt="Hi-ho.jpg" src="http://example.com/images/thumb/9/9d/Hi-ho.jpg/180px-Hi-ho.jpg" decoding="async" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/9/9d/Hi-ho.jpg/270px-Hi-ho.jpg 1.5x, http://example.com/images/thumb/9/9d/Hi-ho.jpg/360px-Hi-ho.jpg 2x" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Hi-ho.jpg" class="internal" title="Enlarge"></a></div></div></div></div> |
| 3959 |
<ul class="gallery mw-gallery-traditional"> |
| 3960 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 3961 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Hi-ho.jpg" class="image"><img alt="Hi-ho.jpg" src="http://example.com/images/thumb/9/9d/Hi-ho.jpg/120px-Hi-ho.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/9/9d/Hi-ho.jpg/180px-Hi-ho.jpg 1.5x, http://example.com/images/thumb/9/9d/Hi-ho.jpg/240px-Hi-ho.jpg 2x" /></a></div></div> |
| 3962 |
<div class="gallerytext"></div> |
| 3963 |
</div></li> |
| 3964 |
<li class="gallerybox" style="width: 155px"><div style="width: 155px"> |
| 3965 |
<div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Hi-ho.jpg" class="image"><img alt="Hi-ho.jpg" src="http://example.com/images/thumb/9/9d/Hi-ho.jpg/120px-Hi-ho.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/9/9d/Hi-ho.jpg/180px-Hi-ho.jpg 1.5x, http://example.com/images/thumb/9/9d/Hi-ho.jpg/240px-Hi-ho.jpg 2x" /></a></div></div> |
| 3966 |
<div class="gallerytext"></div> |
| 3967 |
</div></li> |
| 3968 |
</ul> |
| 3969 |
!! html/parsoid |
| 3970 |
<figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Hi-ho.jpg" class="mw-file-description"><img resource="./File:Hi-ho.jpg" src="http://example.com/images/thumb/9/9d/Hi-ho.jpg/180px-Hi-ho.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" srcset="http://example.com/images/thumb/9/9d/Hi-ho.jpg/270px-Hi-ho.jpg 1.5x, http://example.com/images/thumb/9/9d/Hi-ho.jpg/360px-Hi-ho.jpg 2x" class="mw-file-element" data-parsoid='{"a":{"resource":"./File:Hi-ho.jpg","height":"20","width":"180"},"sa":{"resource":"File:Hi&#45;ho.jpg"}}'/></a><figcaption></figcaption></figure> |
| 3971 |
|
| 3972 |
<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt2" data-parsoid='{"dsr":[30,83,9,10]}' data-mw='{"name":"gallery","attrs":{},"body":{}}'> |
| 3973 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File"><a href="./File:Hi-ho.jpg" class="mw-file-description"><img resource="./File:Hi-ho.jpg" src="http://example.com/images/thumb/9/9d/Hi-ho.jpg/120px-Hi-ho.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/9/9d/Hi-ho.jpg/180px-Hi-ho.jpg 1.5x, http://example.com/images/thumb/9/9d/Hi-ho.jpg/240px-Hi-ho.jpg 2x" class="mw-file-element" data-parsoid='{"a":{"resource":"./File:Hi-ho.jpg","height":"14","width":"120"},"sa":{"resource":"Hi&#45;ho.jpg"}}'/></a></span></div><div class="gallerytext"></div></li> |
| 3974 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File"><a href="./File:Hi-ho.jpg" class="mw-file-description"><img resource="./File:Hi-ho.jpg" src="http://example.com/images/thumb/9/9d/Hi-ho.jpg/120px-Hi-ho.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/9/9d/Hi-ho.jpg/180px-Hi-ho.jpg 1.5x, http://example.com/images/thumb/9/9d/Hi-ho.jpg/240px-Hi-ho.jpg 2x" class="mw-file-element" data-parsoid='{"a":{"resource":"./File:Hi-ho.jpg","height":"14","width":"120"},"sa":{"resource":"File:Hi&#45;ho.jpg"}}'/></a></span></div><div class="gallerytext"></div></li> |
| 3975 |
</ul> |
| 3976 |
!! end |