Modul:Section link: Unterschied zwischen den Versionen
use require('strict') instead of require('Module:No globals')
K (2 Versionen von skanwiki:Modul:Section_link importiert) |
(use require('strict') instead of require('Module:No globals')) |
||
Zeile 1: | Zeile 1: | ||
-- This module implements {{section link}}. | -- This module implements {{section link}}. | ||
require(' | require('strict'); | ||
local checkType = require('libraryUtil').checkType | local checkType = require('libraryUtil').checkType | ||
Zeile 9: | Zeile 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 |