Ad placeholder

Module:ParseList: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 42: Line 42:
Drow = "Drow",
Drow = "Drow",
drow = "drow",
drow = "drow",
-- Creature types
Fey = "Fey",
fey = "fey",
Undead = "Undead",
undead = "undead",
}
}
local function pluralize(str)
local sp = specialPlurals[str]
if sp then
return sp
end
if str:sub(-1) == "y" then
return str:sub(1, -2) .. "ies"
end
return str .. "s"
end


local function processElement(str)
local function processElement(str)
if pluralizeElements then
if pluralizeElements then
local plural = specialPlurals[str] or str .. "s"
local plural = pluralize(str)
if makeElementsLinks then
if makeElementsLinks then
return "[[" .. str .. "|" .. plural .. "]]"
return "[[" .. str .. "|" .. plural .. "]]"

Navigation menu