r53098 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53097‎ | r53098 | r53099 >
Date:04:47, 11 July 2009
Author:rememberthedot
Status:ok
Tags:
Comment:
Updated parser tests for r52726. Also fixed some corner cases and updated the parser test for PMID links.
Modified paths:
  • /trunk/phase3/includes/Linker.php (modified) (history)
  • /trunk/phase3/includes/MediaTransformOutput.php (modified) (history)
  • /trunk/phase3/maintenance/parserTests.txt (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Linker.php
@@ -89,7 +89,7 @@
9090 */
9191 private function getLinkAttributesInternal( $title, $class, $classDefault = false ) {
9292 $title = htmlspecialchars( $title );
93 - if( $class === '' and $classDefault !== false ) {
 93+ if ( $class === '' and $classDefault !== false ) {
9494 # FIXME: Parameter defaults the hard way! We should just have
9595 # $class = 'external' or whatever as the default in the externally-
9696 # exposed functions, not $class = ''.
@@ -97,10 +97,12 @@
9898 }
9999 $class = htmlspecialchars( $class );
100100 $r = '';
101 - if( $class !== '' ) {
 101+ if ( $class != '' ) {
102102 $r .= " class=\"$class\"";
103103 }
104 - $r .= " title=\"$title\"";
 104+ if ( $title != '') {
 105+ $r .= " title=\"$title\"";
 106+ }
105107 return $r;
106108 }
107109
Index: trunk/phase3/includes/MediaTransformOutput.php
@@ -80,17 +80,19 @@
8181 }
8282 }
8383
84 - function getDescLinkAttribs( $alt = false, $params = '' ) {
 84+ function getDescLinkAttribs( $title = null, $params = '' ) {
8585 $query = $this->page ? ( 'page=' . urlencode( $this->page ) ) : '';
8686 if( $params ) {
8787 $query .= $query ? '&'.$params : $params;
8888 }
89 - $title = $this->file->getTitle();
90 - return array(
 89+ $attribs = array(
9190 'href' => $this->file->getTitle()->getLocalURL( $query ),
9291 'class' => 'image',
93 - 'title' => $alt
9492 );
 93+ if ( $title ) {
 94+ $attribs['title'] = $title;
 95+ }
 96+ return $attribs;
9597 }
9698 }
9799
@@ -148,22 +150,22 @@
149151 }
150152
151153 $alt = empty( $options['alt'] ) ? '' : $options['alt'];
152 - # Note: if title is empty and alt is not, make the title empty, don't
153 - # use alt; only use alt if title is not set
154 - $title = !isset( $options['title'] ) ? $alt : $options['title'];
155 - $query = empty($options['desc-query']) ? '' : $options['desc-query'];
156154
 155+ $query = empty( $options['desc-query'] ) ? '' : $options['desc-query'];
 156+
157157 if ( !empty( $options['custom-url-link'] ) ) {
158158 $linkAttribs = array( 'href' => $options['custom-url-link'] );
159 - if ( $alt ) {
160 - $linkAttribs['title'] = $alt;
 159+ if ( !empty( $options['title'] ) ) {
 160+ $linkAttribs['title'] = $options['title'];
161161 }
162162 } elseif ( !empty( $options['custom-title-link'] ) ) {
163163 $title = $options['custom-title-link'];
164 - $linkAttribs = array( 'href' => $title->getLinkUrl(),
165 - 'title' => $alt );
 164+ $linkAttribs = array(
 165+ 'href' => $title->getLinkUrl(),
 166+ 'title' => empty( $options['title'] ) ? $title->getFullText() : $options['title']
 167+ );
166168 } elseif ( !empty( $options['desc-link'] ) ) {
167 - $linkAttribs = $this->getDescLinkAttribs( $title, $query );
 169+ $linkAttribs = $this->getDescLinkAttribs( empty( $options['title'] ) ? null : $options['title'], $query );
168170 } elseif ( !empty( $options['file-link'] ) ) {
169171 $linkAttribs = array( 'href' => $this->file->getURL() );
170172 } else {
Index: trunk/phase3/maintenance/parserTests.txt
@@ -2198,7 +2198,7 @@
21992199 !! input
22002200 PMID 1234
22012201 !! result
2202 -<p><a href="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&amp;db=pubmed&amp;dopt=Abstract&amp;list_uids=1234" class="external" title="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&amp;db=pubmed&amp;dopt=Abstract&amp;list_uids=1234">PMID 1234</a>
 2202+<p><a href="http://www.ncbi.nlm.nih.gov/pubmed/1234?dopt=Abstract" class="external" title="http://www.ncbi.nlm.nih.gov/pubmed/1234?dopt=Abstract">PMID 1234</a>
22032203 </p>
22042204 !! end
22052205
@@ -3130,7 +3130,7 @@
31313131 !! input
31323132 [[Image:foobar.jpg]]
31333133 !! result
3134 -<p><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image" title="Image:foobar.jpg"><img alt="Image:foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 3134+<p><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
31353135 </p>
31363136 !! end
31373137
@@ -3139,7 +3139,7 @@
31403140 !! input
31413141 [[Image:foobar.jpg|right]]
31423142 !! result
3143 -<div class="floatright"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image" title="Foobar.jpg"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a></div>
 3143+<div class="floatright"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a></div>
31443144
31453145 !! end
31463146
@@ -3148,7 +3148,7 @@
31493149 !! input
31503150 [[File:foobar.jpg]]
31513151 !! result
3152 -<p><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image" title="File:foobar.jpg"><img alt="File:foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 3152+<p><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
31533153 </p>
31543154 !! end
31553155
@@ -3166,7 +3166,7 @@
31673167 !! input
31683168 [[Image:foobar.jpg|link=Target page]]
31693169 !! result
3170 -<p><a href="https://www.mediawiki.org/wiki/Target_page" title="Target page"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 3170+<p><a href="https://www.mediawiki.org/wiki/Target_page" title="Target page"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
31713171 </p>
31723172 !! end
31733173
@@ -3175,7 +3175,7 @@
31763176 !! input
31773177 [[Image:foobar.jpg|link=http://example.com/]]
31783178 !! result
3179 -<p><a href="http://example.com/"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 3179+<p><a href="http://example.com/"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
31803180 </p>
31813181 !! end
31823182
@@ -3184,7 +3184,7 @@
31853185 !! input
31863186 [[Image:foobar.jpg|link=]]
31873187 !! result
3188 -<p><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" />
 3188+<p><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" />
31893189 </p>
31903190 !! end
31913191
@@ -3213,7 +3213,7 @@
32143214 !! input
32153215 [[Image:Foobar.jpg|frame|left|This is a test image [[Main Page]]]]
32163216 !! result
3217 -<div class="thumb tleft"><div class="thumbinner" style="width:1943px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image" title="This is a test image Main Page"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" class="thumbimage" /></a> <div class="thumbcaption">This is a test image <a href="https://www.mediawiki.org/wiki/Main_Page" title="Main Page">Main Page</a></div></div></div>
 3217+<div class="thumb tleft"><div class="thumbinner" style="width:1943px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" class="thumbimage" /></a> <div class="thumbcaption">This is a test image <a href="https://www.mediawiki.org/wiki/Main_Page" title="Main Page">Main Page</a></div></div></div>
32183218
32193219 !! end
32203220
@@ -3222,7 +3222,7 @@
32233223 !! input
32243224 [[Image:Foobar.jpg|frame|left|This is a test image [[Main Page]]|alt=Altitude]]
32253225 !! result
3226 -<div class="thumb tleft"><div class="thumbinner" style="width:1943px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image" title="This is a test image Main Page"><img alt="Altitude" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" class="thumbimage" /></a> <div class="thumbcaption">This is a test image <a href="https://www.mediawiki.org/wiki/Main_Page" title="Main Page">Main Page</a></div></div></div>
 3226+<div class="thumb tleft"><div class="thumbinner" style="width:1943px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Altitude" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" class="thumbimage" /></a> <div class="thumbcaption">This is a test image <a href="https://www.mediawiki.org/wiki/Main_Page" title="Main Page">Main Page</a></div></div></div>
32273227
32283228 !! end
32293229
@@ -3240,7 +3240,7 @@
32413241 !! input
32423242 [[Image:Foobar.jpg|alt=testing '''bold''' in alt]]
32433243 !! result
3244 -<p><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image" title="Foobar.jpg"><img alt="testing bold in alt" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 3244+<p><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="testing bold in alt" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
32453245 </p>
32463246 !! end
32473247
@@ -3269,7 +3269,7 @@
32703270 !! input
32713271 [[Image:foobar.jpg|thumb|http://example.com]]
32723272 !! result
3273 -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image" title="http://example.com"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div><a href="http://example.com" class="external free" title="http://example.com" rel="nofollow">http://example.com</a></div></div></div>
 3273+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div><a href="http://example.com" class="external free" title="http://example.com" rel="nofollow">http://example.com</a></div></div></div>
32743274
32753275 !! end
32763276
@@ -3278,7 +3278,7 @@
32793279 !! input
32803280 [[Image:foobar.jpg|thumb|http://example.com|alt=Alteration]]
32813281 !! result
3282 -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image" title="http://example.com"><img alt="Alteration" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div><a href="http://example.com" class="external free" title="http://example.com" rel="nofollow">http://example.com</a></div></div></div>
 3282+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Alteration" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div><a href="http://example.com" class="external free" title="http://example.com" rel="nofollow">http://example.com</a></div></div></div>
32833283
32843284 !! end
32853285
@@ -3287,7 +3287,7 @@
32883288 !! input
32893289 [[Image:foobar.jpg|thumb|ISBN 1235467890]]
32903290 !! result
3291 -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image" title="ISBN 1235467890"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div><a href="https://www.mediawiki.org/wiki/Special:BookSources/1235467890" class="internal">ISBN 1235467890</a></div></div></div>
 3291+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div><a href="https://www.mediawiki.org/wiki/Special:BookSources/1235467890" class="internal">ISBN 1235467890</a></div></div></div>
32923292
32933293 !! end
32943294
@@ -3296,7 +3296,7 @@
32973297 !! input
32983298 [[Image:foobar.jpg|thumb|This is RFC 12354]]
32993299 !! result
3300 -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image" title="This is RFC 12354"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>This is <a href="http://tools.ietf.org/html/rfc12354" class="external" title="http://tools.ietf.org/html/rfc12354">RFC 12354</a></div></div></div>
 3300+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>This is <a href="http://tools.ietf.org/html/rfc12354" class="external" title="http://tools.ietf.org/html/rfc12354">RFC 12354</a></div></div></div>
33013301
33023302 !! end
33033303
@@ -3305,7 +3305,7 @@
33063306 !! input
33073307 [[Image:foobar.jpg|thumb|Please mailto:nobody@example.com]]
33083308 !! result
3309 -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image" title="Please mailto:nobody@example.com"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>Please <a href="mailto:nobody@example.com" class="external free" title="mailto:nobody@example.com" rel="nofollow">mailto:nobody@example.com</a></div></div></div>
 3309+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>Please <a href="mailto:nobody@example.com" class="external free" title="mailto:nobody@example.com" rel="nofollow">mailto:nobody@example.com</a></div></div></div>
33103310
33113311 !! end
33123312
@@ -3315,7 +3315,7 @@
33163316 !! input
33173317 [[Image:foobar.jpg|thumb|<math>2+2</math>]]
33183318 !! result
3319 -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image" title="&lt;math&gt;2+2&lt;/math&gt;"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>&lt;math&gt;2+2&lt;/math&gt;</div></div></div>
 3319+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>&lt;math&gt;2+2&lt;/math&gt;</div></div></div>
33203320
33213321 !! end
33223322
@@ -3326,7 +3326,7 @@
33273327 !! input
33283328 [[Image:foobar.jpg|thumb|<math>2+2</math>]]
33293329 !! result
3330 -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image" title="2 + 2"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div><span class="texhtml">2 + 2</span></div></div></div>
 3330+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div><span class="texhtml">2 + 2</span></div></div></div>
33313331
33323332 !! end
33333333
@@ -3399,7 +3399,7 @@
34003400 !! input
34013401 [[Image:Foobar.jpg|thumb|This is a caption with another [[Image:icon.png|image]] inside it!]]
34023402 !! result
3403 -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image" title="This is a caption with another File:Icon.png inside it!"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>This is a caption with another <a href="https://www.mediawiki.org/index.php?title=Special:Upload&amp;wpDestFile=Icon.png" class="new" title="File:Icon.png">File:Icon.png</a> inside it!</div></div></div>
 3403+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>This is a caption with another <a href="https://www.mediawiki.org/index.php?title=Special:Upload&amp;wpDestFile=Icon.png" class="new" title="File:Icon.png">File:Icon.png</a> inside it!</div></div></div>
34043404
34053405 !! end
34063406
@@ -3419,7 +3419,7 @@
34203420 !! input
34213421 [[Image:Foobar.jpg|thumb|200px|This caption has [irc://example.net irc] and [https://example.com Secure] ext links in it.]]
34223422 !! result
3423 -<div class="thumb tright"><div class="thumbinner" style="width:202px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image" title="This caption has irc and Secure ext links in it."><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" width="200" height="23" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>This caption has <a href="irc://example.net" class="external text" title="irc://example.net" rel="nofollow">irc</a> and <a href="https://example.com" class="external text" title="https://example.com" rel="nofollow">Secure</a> ext links in it.</div></div></div>
 3423+<div class="thumb tright"><div class="thumbinner" style="width:202px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" width="200" height="23" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>This caption has <a href="irc://example.net" class="external text" title="irc://example.net" rel="nofollow">irc</a> and <a href="https://example.com" class="external text" title="https://example.com" rel="nofollow">Secure</a> ext links in it.</div></div></div>
34243424
34253425 !! end
34263426
@@ -3822,7 +3822,7 @@
38233823 !! input
38243824 http://example.com [[Image:foobar.jpg]]
38253825 !! result
3826 -<p><a href="http://example.com" class="external free" title="http://example.com" rel="nofollow">http://example.com</a> <a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image" title="Image:foobar.jpg"><img alt="Image:foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 3826+<p><a href="http://example.com" class="external free" title="http://example.com" rel="nofollow">http://example.com</a> <a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
38273827 </p>
38283828 !!end
38293829
@@ -3831,7 +3831,7 @@
38323832 !! input
38333833 http://example.com[[Image:foobar.jpg]]
38343834 !! result
3835 -<p><a href="http://example.com" class="external free" title="http://example.com" rel="nofollow">http://example.com</a><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image" title="Image:foobar.jpg"><img alt="Image:foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 3835+<p><a href="http://example.com" class="external free" title="http://example.com" rel="nofollow">http://example.com</a><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
38363836 </p>
38373837 !!end
38383838
@@ -6339,7 +6339,7 @@
63406340 !! input
63416341 [[Image:foobar.jpg|centre]]
63426342 !! result
6343 -<div class="center"><div class="floatnone"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image" title="Foobar.jpg"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a></div></div>
 6343+<div class="center"><div class="floatnone"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a></div></div>
63446344
63456345 !!end
63466346
@@ -6348,7 +6348,7 @@
63496349 !! input
63506350 [[Image:foobar.jpg|none]]
63516351 !! result
6352 -<div class="floatnone"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image" title="Foobar.jpg"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a></div>
 6352+<div class="floatnone"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a></div>
63536353
63546354 !!end
63556355
@@ -6357,7 +6357,7 @@
63586358 !! input
63596359 [[Image:foobar.jpg|640x480px]]
63606360 !! result
6361 -<p><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image" title="Foobar.jpg"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" width="640" height="73" /></a>
 6361+<p><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" width="640" height="73" /></a>
63626362 </p>
63636363 !!end
63646364
@@ -6366,7 +6366,7 @@
63676367 !! input
63686368 [[Image:foobar.jpg|640px]]
63696369 !! result
6370 -<p><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image" title="Foobar.jpg"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" width="640" height="73" /></a>
 6370+<p><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" width="640" height="73" /></a>
63716371 </p>
63726372 !!end
63736373
@@ -6375,7 +6375,7 @@
63766376 !! input
63776377 [[Image:foobar.jpg|640px ]]
63786378 !! result
6379 -<p><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image" title="Foobar.jpg"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" width="640" height="73" /></a>
 6379+<p><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" width="640" height="73" /></a>
63806380 </p>
63816381 !!end
63826382
@@ -6384,7 +6384,7 @@
63856385 !! input
63866386 [[Image:foobar.jpg| 640px]]
63876387 !! result
6388 -<p><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image" title="Foobar.jpg"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" width="640" height="73" /></a>
 6388+<p><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" width="640" height="73" /></a>
63896389 </p>
63906390 !!end
63916391
@@ -6422,7 +6422,7 @@
64236423 !! input
64246424 [[image:Foobar.jpg|thumb|An [http://test/?param1=|left|&param2=|x external] URL]]
64256425 !! result
6426 -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image" title="An external URL"><img alt="An external URL" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>An <a href="http://test/?param1=|left|&amp;param2=|x" class="external text" title="http://test/?param1=|left|&amp;param2=|x" rel="nofollow">external</a> URL</div></div></div>
 6426+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="An external URL" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>An <a href="http://test/?param1=|left|&amp;param2=|x" class="external text" title="http://test/?param1=|left|&amp;param2=|x" rel="nofollow">external</a> URL</div></div></div>
64276427
64286428 !!end
64296429
@@ -7227,7 +7227,7 @@
72287228 !! input
72297229 [[Image:Foobar.jpg|thumb|http://x|hello]]
72307230 !! result
7231 -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image" title="hello"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>hello</div></div></div>
 7231+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>hello</div></div></div>
72327232
72337233 !! end
72347234

Follow-up revisions

RevisionCommit summaryAuthorDate
r69960Fix parsertest broken in r53291. In trunk it was fixed along other changes wi...platonides19:02, 26 July 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r52726Title attributes are now always blank on framed and thumbnailed images, and d...rememberthedot05:13, 3 July 2009

Status & tagging log