I have previosly written about speculative execution in the lexer. To exactly reproduce the behavior of the image links, not only one, but two speculations will be necessary. However, this is very complex and the use case is undocumented so I would like to simplify these.
The original beheviour is as follows: the option list is split on the '|' character; the caption is the _last_ non-option in the list, if any.
So, to reproduce this, a separate speculation has to be initiated for the caption. If another caption (non-option) is seen in the list, the speculation will fail.
Furthermore, media link may nest one level. If a MEDIA_LINK or INTERNAL_LINK appears in the caption of the second level, the production will completely fail.
I think that the following is a reasonable simplification: image links may not nest (although internal links and external links may appear in the caption of a media link), The _first_ non-option in the list is the caption and no options may appear after the caption. In this way, only one speculation is required for media links, and the lexer can handle the option list. This behavior seems consistent with the documentation at http://www.mediawiki.org/wiki/Help:Images.
Is there any known use for putting an image inside an image caption, or is the restriction I propose here sufficient?
Best regards,
Andreas Jonsson
Andreas Jonsson wrote:
Is there any known use for putting an image inside an image caption, or is the restriction I propose here sufficient?
Doesn't seem like an important feature. Although I'm pretty sure that someone would be using it. Like using an image to note the language, an IPA logotype...
I images in captions all the time actually for situations like "The yellow circle [[Image:circle-yellow.png]] on this map indicates..."
-----Original Message----- From: wikitext-l-bounces@lists.wikimedia.org [mailto:wikitext-l-bounces@lists.wikimedia.org] On Behalf Of Platonides Sent: Tuesday, August 31, 2010 11:54 AM To: Wikitext-l Subject: Re: [Wikitext-l] Image links
Andreas Jonsson wrote:
Is there any known use for putting an image inside an image caption, or is the restriction I propose here sufficient?
Doesn't seem like an important feature. Although I'm pretty sure that someone would be using it. Like using an image to note the language, an IPA logotype...
_______________________________________________ Wikitext-l mailing list Wikitext-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitext-l
2010-08-31 21:33, mrthetooth skrev:
I images in captions all the time actually for situations like "The yellow circle [[Image:circle-yellow.png]] on this map indicates..."
Ok, I'll add support for one nesting level for images.
/Andreas
-----Original Message----- From: wikitext-l-bounces@lists.wikimedia.org [mailto:wikitext-l-bounces@lists.wikimedia.org] On Behalf Of Platonides Sent: Tuesday, August 31, 2010 11:54 AM To: Wikitext-l Subject: Re: [Wikitext-l] Image links
Andreas Jonsson wrote:
Is there any known use for putting an image inside an image caption, or is the restriction I propose here sufficient?
Doesn't seem like an important feature. Although I'm pretty sure that someone would be using it. Like using an image to note the language, an IPA logotype...
Wikitext-l mailing list Wikitext-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitext-l
Wikitext-l mailing list Wikitext-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitext-l
wikitext-l@lists.wikimedia.org