View source for Module:Section link
From Black Cat Studios
Jump to navigationJump to search
You do not have permission to edit this page, for the following reason:
You can view and copy the source of this page.
-- This module implements {{section link}}.
require('strict');
local checkType = require('libraryUtil').checkType
local p = {}
local function makeSectionLink(page, section, display)
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
local function normalizeTitle(title)
title = mw.ustring.gsub(mw.ustring.gsub(title, "'", ""), '"', '')
000
1:0
Template used on this page:
Return to Module:Section link.