Anonymous user
Module:Section link: Difference between revisions
fix error for when {{}} are used inside of the slink (TPER)
en>Trappist the monk (percent-decode;) |
en>Primefac (fix error for when {{}} are used inside of the slink (TPER)) |
||
Line 9: | Line 9: | ||
display = display or section | display = display or section | ||
page = page or '' | page = page or '' | ||
-- MediaWiki doesn't allow these in `page`, so only need to do for `section` | |||
if type(section) == 'string' then | |||
section = string.gsub(section, "{", "{") | |||
section = string.gsub(section, "}", "}") | |||
end | |||
return string.format('[[%s#%s|%s]]', page, section, display) | return string.format('[[%s#%s|%s]]', page, section, display) | ||
end | end |