Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -146,6 +146,8 @@ |
147 | 147 | $wgExternalLinkTarget |
148 | 148 | * (bug 674) Allow admins to block users from editing specific articles and |
149 | 149 | namespaces |
| 150 | +* (bug 368) Don't use caption for alt attribute; allow manual specification |
| 151 | + using new "alt=" parameter for images |
150 | 152 | |
151 | 153 | === Bug fixes in 1.14 === |
152 | 154 | |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -287,6 +287,7 @@ |
288 | 288 | 'img_middle' => array( 1, 'middle' ), |
289 | 289 | 'img_bottom' => array( 1, 'bottom' ), |
290 | 290 | 'img_text_bottom' => array( 1, 'text-bottom' ), |
| 291 | + 'img_alt' => array( 1, 'alt=$1', 'alt $1' ), |
291 | 292 | 'int' => array( 0, 'INT:' ), |
292 | 293 | 'sitename' => array( 1, 'SITENAME' ), |
293 | 294 | 'ns' => array( 0, 'NS:' ), |
Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -4186,7 +4186,7 @@ |
4187 | 4187 | 'vertAlign' => array( 'baseline', 'sub', 'super', 'top', 'text-top', 'middle', |
4188 | 4188 | 'bottom', 'text-bottom' ), |
4189 | 4189 | 'frame' => array( 'thumbnail', 'manualthumb', 'framed', 'frameless', |
4190 | | - 'upright', 'border' ), |
| 4190 | + 'upright', 'border', 'alt' ), |
4191 | 4191 | ); |
4192 | 4192 | static $internalParamMap; |
4193 | 4193 | if ( !$internalParamMap ) { |
— | — | @@ -4222,16 +4222,17 @@ |
4223 | 4223 | function makeImage( $title, $options, $holders = false ) { |
4224 | 4224 | # Check if the options text is of the form "options|alt text" |
4225 | 4225 | # Options are: |
4226 | | - # * thumbnail make a thumbnail with enlarge-icon and caption, alignment depends on lang |
4227 | | - # * left no resizing, just left align. label is used for alt= only |
4228 | | - # * right same, but right aligned |
4229 | | - # * none same, but not aligned |
4230 | | - # * ___px scale to ___ pixels width, no aligning. e.g. use in taxobox |
4231 | | - # * center center the image |
4232 | | - # * framed Keep original image size, no magnify-button. |
4233 | | - # * frameless like 'thumb' but without a frame. Keeps user preferences for width |
4234 | | - # * upright reduce width for upright images, rounded to full __0 px |
4235 | | - # * border draw a 1px border around the image |
| 4226 | + # * thumbnail make a thumbnail with enlarge-icon and caption, alignment depends on lang |
| 4227 | + # * left no resizing, just left align. label is used for alt= only |
| 4228 | + # * right same, but right aligned |
| 4229 | + # * none same, but not aligned |
| 4230 | + # * ___px scale to ___ pixels width, no aligning. e.g. use in taxobox |
| 4231 | + # * center center the image |
| 4232 | + # * framed Keep original image size, no magnify-button. |
| 4233 | + # * frameless like 'thumb' but without a frame. Keeps user preferences for width |
| 4234 | + # * upright reduce width for upright images, rounded to full __0 px |
| 4235 | + # * border draw a 1px border around the image |
| 4236 | + # * alt Text for HTML alt attribute (defaults to empty) |
4236 | 4237 | # vertical-align values (no % or length right now): |
4237 | 4238 | # * baseline |
4238 | 4239 | # * sub |
— | — | @@ -4300,7 +4301,8 @@ |
4301 | 4302 | } else { |
4302 | 4303 | # Validate internal parameters |
4303 | 4304 | switch( $paramName ) { |
4304 | | - case "manualthumb": |
| 4305 | + case 'manualthumb': |
| 4306 | + case 'alt': |
4305 | 4307 | /// @fixme - possibly check validity here? |
4306 | 4308 | /// downstream behavior seems odd with missing manual thumbs. |
4307 | 4309 | $validated = true; |
— | — | @@ -4329,22 +4331,6 @@ |
4330 | 4332 | $params['frame']['valign'] = key( $params['vertAlign'] ); |
4331 | 4333 | } |
4332 | 4334 | |
4333 | | - # Strip bad stuff out of the alt text |
4334 | | - # We can't just use replaceLinkHoldersText() here, because if this function |
4335 | | - # is called from replaceInternalLinks2(), mLinkHolders won't be up to date. |
4336 | | - if ( $holders ) { |
4337 | | - $alt = $holders->replaceText( $caption ); |
4338 | | - } else { |
4339 | | - $alt = $this->replaceLinkHoldersText( $caption ); |
4340 | | - } |
4341 | | - |
4342 | | - # make sure there are no placeholders in thumbnail attributes |
4343 | | - # that are later expanded to html- so expand them now and |
4344 | | - # remove the tags |
4345 | | - $alt = $this->mStripState->unstripBoth( $alt ); |
4346 | | - $alt = Sanitizer::stripAllTags( $alt ); |
4347 | | - |
4348 | | - $params['frame']['alt'] = $alt; |
4349 | 4335 | $params['frame']['caption'] = $caption; |
4350 | 4336 | |
4351 | 4337 | wfRunHooks( 'ParserMakeImageParams', array( $title, $file, &$params ) ); |