Jump to content

Module talk:Template parameter value

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Dpleibovitz (talk | contribs) at 23:34, 12 May 2019 (Handling transclusion within a parameter value). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

There is currently a bug with piped links, see example below:

  • {{Template parameter value|Charmander|Infobox video game character|1|firstgame|1}} ->

The result should have been [[Pokémon Red and Blue|''Pokémon Red'' and ''Blue'']]. --Gonnym (talk) 19:48, 1 February 2019 (UTC)[reply]

I am aware, and I've been looking into fixing this. Cheers. -- /Alex/21 22:49, 1 February 2019 (UTC)[reply]

Not handling nesting correctly

If a parameter value includes a single nested transclusion (multiple ones are not handled), the last match() does not work correctly. In my fork, I have changed

content = string.match(content, '^([^|}]*{{[^}]+}}[^|}]*)|') or string.match(content, '([^|}]+)')

to

content = string.match(content, '^([^|{}]*{{[^}]+}}[^|}]*)[|}]') or string.match(content, '([^|}]+)')

The next line then preprocess()es the transclussion correctly, as was its intention. This was likely not found before, because short-descriptions shouldn't have such, but my fork does.

Dpleibovitz (talk) 23:34, 12 May 2019 (UTC)[reply]