More actions
(Created page with "local p = {} function p.processTitle(frame) local input = frame.args[1] or "" -- Check if input already looks like a {{Title}} template if mw.ustring.match(input, "^%s*%{%{%s*[Tt]itle%s*[|}]") then return input end -- Otherwise wrap it in {{Title|name=...}} return string.format("{{Title|name=%s}}", input) end return p") |
Arvid Varg (talk | contribs) No edit summary |
||
| Line 11: | Line 11: | ||
-- Otherwise wrap it in {{Title|name=...}} | -- Otherwise wrap it in {{Title|name=...}} | ||
return string.format("{{Title|name=%s}}", input) | return string.format("{{Title|name=%s}}", input) | ||
end | |||
function p.stripHouse(frame) | |||
local name = mw.title.getCurrentTitle().text | |||
return name:gsub("^House%s+", "") | |||
end | end | ||
return p | return p | ||
Revision as of 20:49, 30 March 2026
Titles
! colspan="2" class="infobox-subheader" | Not on a character |-
! colspan="2" class="infobox-subheader" |
|-
| Gnoblin |
|---|
| Gnoblin |
|---|
local p = {}
function p.processTitle(frame)
local input = frame.args[1] or ""
-- Check if input already looks like a {{Title}} template
if mw.ustring.match(input, "^%s*%{%{%s*[Tt]itle%s*[|}]") then
return input
end
-- Otherwise wrap it in {{Title|name=...}}
return string.format("{{Title|name=%s}}", input)
end
function p.stripHouse(frame)
local name = mw.title.getCurrentTitle().text
return name:gsub("^House%s+", "")
end
return p