Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Gnoblin: Difference between revisions

From Deepest Lore
No edit summary
No edit summary
Line 9: Line 9:
     end
     end


    -- Otherwise wrap it in {{Title|name=...}}
  -- Otherwise, expand the template properly
     return string.format("{{Title|name=%s}}", input)
     return frame:expandTemplate{
        title = "Title",
        args = { name = input }
    }
end
end



Revision as of 21:02, 30 March 2026

Titles

! colspan="2" class="infobox-subheader" | Not on a character |-



! colspan="2" class="infobox-subheader" | |-

Gnoblin
Using the template
Gnoblin
Simple name only

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, expand the template properly
    return frame:expandTemplate{
        title = "Title",
        args = { name = input }
    }
end

function p.stripHouse(frame)
    local name = mw.title.getCurrentTitle().text
    local result = mw.ustring.gsub(name, "^[Hh]ouse%s+", "")
    return result
end

return p
Contents