Module:HTMLParse: Difference between revisions

Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 2: Line 2:


function p.pluralize(frame)
function p.pluralize(frame)
     local htmlString = frame.args[1]
     local htmlString = frame.args.html
     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