MediaWiki r41837 - Code Review

Jump to: navigation, search
Revision:r41836‎ | r41837 (on ViewVC)‎ | r41838 >
Date:16:33, 8 October 2008
Status:old (Comments)
(bug 368) Allow alt= attribute for images

Alt text is now set in the following ways, in decreasing priority:

1) Set to the alt= parameter if present.
2) Set to the unnamed (caption) parameter if present, and if the image does not have the thumb or frame option set (i.e., if the unnamed parameter is not actually being used for a caption -- using it as both caption and alt text would just lead to text being repeated).
3) Set to the empty string.

Title text and captions should not be affected in any case. The only backward-compatibility effect (i.e., on images not using the new alt= syntax) should be that if previously the same text was repeated in the alt text and then again in the caption, the alt text will now be empty. Setting the alt parameter should never change the HTML output compared to not setting it, except of course changing the alt text.

All parser tests pass, except the usual ones.
Modified paths:

Diff [purge]

Loading diff…

Follow-up revisions

Rev.Commit summaryAuthorDate
r41840Tweak to r41837 -- remove 'alt $1' alias for 'alt=$1', we're not sure we need...brion17:29, 8 October 2008
r42116Fix for r41837 -- apply HTML stripping to explicit alt text as well as implicit....brion21:20, 15 October 2008

Past revisions this follows-up on

Rev.Commit summaryAuthorDate
r41364(bug 368) Allow alt= attribute for images...simetrical21:07, 28 September 2008


#Comment by Brion VIBBER (talk | contribs)   17:35, 8 October 2008


One tiny tweak: removing the 'alt $1' alias for the keyword per IRC discussion (page and upright have such, but link and thumbnail don't). DOne in r41840.

Noticed another issue:

[[Image:Wiki.png|testing '''bold''' in alt]]

[[Image:Wiki.png|alt=testing '''bold''' in alt]]

render the alt text differently; the latter isn't stripping tags.

#Comment by Brion VIBBER (talk | contribs)   21:20, 15 October 2008

Fixed to my satisfcation in r42116

Status & tagging log

  • 18:38, 7 January 2012 Johnduhart (talk | contribs) changed the tags for r41837 [removed: alt]
  • 15:32, 12 September 2011 Meno25 (talk | contribs) changed the status of r41837 [removed: resolved added: old]
  • 20:22, 30 August 2011 😂 (talk | contribs) changed the tags for r41837 [removed: parser]