Module:HTMLParse: Difference between revisions

Jump to navigation Jump to search
mNo edit summary
(add make_possessive)
Line 1: Line 1:
local p = {}
local p = {}


function p.pluralize(frame)
function p.pluralize(frame, apostrophe)
    apostrophe = apostrophe or ''
     local htmlString = frame.args.html
     local htmlString = frame.args.html
     if string.find(htmlString, "{") then
     if string.find(htmlString, "{") then
Line 12: Line 13:
         return htmlString  --return unmodified (ends with 's', like 'boots', so we shouldn't append another 's')
         return htmlString  --return unmodified (ends with 's', like 'boots', so we shouldn't append another 's')
     else
     else
         return (prefix .. 's' .. postfix)
         return (prefix .. apostrophe .. 's' .. postfix)
     end
     end
end
function p.make_possessive(frame)
    return p.pluralize(frame, "'")
end
end


return p
return p