Module:Section link: Difference between revisions

m
13 revisions imported from wikipedia:Module:Section_link
en>Trappist the monk
(percent-decode;)
m (13 revisions imported from wikipedia:Module:Section_link)
 
(2 intermediate revisions by 2 users not shown)
Line 9:
display = display or section
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)
end