Last modified: 2010-05-15 15:33:12 UTC
When an image's alt and/or title attributes are generated from a caption with a link in, the text of the link disappears. For example: "[[Image:Foo|thumb|text with a [[link]] in it]]" should become "text with a link in it", but currently becomes "text with a in it". This may or may not still be a problem once bug 368 is closed - depending what combination of default values we decide to use. The problem arises because internal links are replaced by placeholders, which are comments, so the text of the link is not available once the caption is being processed. It is removed by a substitution which blanks all HTML tags (which at least lets external links appear correctly); otherwise, it would appear as something like "text with a <!-- Link 14 --> in it". The only approach I can think of, is that it might be possible to somehow retrieve the link text from the placeholder code.
(In reply to comment #0) > This may or may not still be a problem once bug 368 is closed - depending what > combination of default values we decide to use. I'm arguing for fixing bug 368 in a way that will make it unnecessary to address this. Besides being the unique in that it can contain links, the caption may actually contain other images, and it is in general a longer description that serves a separate function from the "alt" and "title" attributes. > The only approach I can think of, is that it might be possible to somehow > retrieve the link text from the placeholder code. That would certainly be possible, and if my approach is not adopted, I think that would be the way to go.
(In reply to comment #0) > The only approach I can think of, is that it might be possible to somehow > retrieve the link text from the placeholder code. Looking at how things seem to work, it looks like this would indeed be a viable approach; *but*, the code which *parses* image options is in *Skin.php*, whereas the link-stripping is so far all in Parser.php, so I'd much rather leave this one until I or someone else gets round to putting the image parser in the parser class. I started on that once, but I didn't quite iron out the creases, so I must get back and finish it off.
*** Bug 1332 has been marked as a duplicate of this bug. ***
*** Bug 1568 has been marked as a duplicate of this bug. ***
Note that this has now been fixed by what is described as a "gross hack" in CVS HEAD - because images are parsed in Skin.php (or rather the new helper class Linker.php), it has to use the global Parser object to replace the place-holder. If I ever get round to finishing my patch (bug 689), this will no longer be necessary.
*** Bug 1974 has been marked as a duplicate of this bug. ***
*** Bug 2061 has been marked as a duplicate of this bug. ***
*** Bug 2133 has been marked as a duplicate of this bug. ***
Hallo! This bug seems to be fixed; see [[en:User:Gangleri/tests/bugzilla/images]] Best regards Reinhardt [[user:gangleri]]
When reporting bugs fixed, marked them as such.