Module:Remove parentheses: Difference between revisions
From Amaranth Legacy, available at amaranth-legacy.community
More actions
Content deleted Content added
Tesinormed (talk | contribs) No edit summary |
Tesinormed (talk | contribs) No edit summary |
||
| Line 5: | Line 5: | ||
if not args['scope'] then error('"scope" argument is required') end |
if not args['scope'] then error('"scope" argument is required') end |
||
local scope = args['scope'] |
local scope = args['scope'] |
||
| ⚫ | |||
if displaytitle:find('(' .. scope .. ')') then |
|||
| ⚫ | |||
displaytitle = displaytitle:gsub('%(' .. scope .. '%)') |
|||
end |
|||
return frame:callParserFunction('DISPLAYTITLE', displaytitle) |
|||
end |
end |
||
Revision as of 17:42, January 28, 2025
Removes parentheses in a page title; used by Template:Remove parentheses
local p = {}
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame)
if not args['scope'] then error('"scope" argument is required') end
local scope = args['scope']
local displaytitle = mw.title.getCurrentTitle().fullText
if displaytitle:find('(' .. scope .. ')') then
displaytitle = displaytitle:gsub('%(' .. scope .. '%)')
end
return frame:callParserFunction('DISPLAYTITLE', displaytitle)
end
return p