8,290
edits
mNo edit summary |
mNo edit summary |
||
Line 3: | Line 3: | ||
function p.pluralize(frame) | function p.pluralize(frame) | ||
local htmlString = frame.args.html | local htmlString = frame.args.html | ||
htmlString = frame:preprocess(htmlString) --expand any templates that may have been passed to this module | |||
prefix, postfix = htmlString:match'(.*%a)(</.*)' --split string at the last alphabetic character that appears immediately before a closing html tag </...> | prefix, postfix = htmlString:match'(.*%a)(</.*)' --split string at the last alphabetic character that appears immediately before a closing html tag </...> | ||
if (prefix == nil or prefix == '' or postfix == nil or postfix == '') then | if (prefix == nil or prefix == '' or postfix == nil or postfix == '') then |