Modul:Detect singular: Unterschied zwischen den Versionen

K
52 Versionen von wpen:Module:Detect_singular importiert
(update force singular/plural detection strings)
K (52 Versionen von wpen:Module:Detect_singular importiert)
 
(2 dazwischenliegende Versionen von einem anderen Benutzer werden nicht angezeigt)
Zeile 47: Zeile 47:
end
end
s = tostring(s)
s = tostring(s)
s = mw.text.decode(s,true)  --- replace HTML entities (to avoid spurious semicolons)
if plainFind(s,'data-plural="0"') then -- magic data string to return true
if plainFind(s,'data-plural="0"') then -- magic data string to return true
return singular
return singular
Zeile 67: Zeile 68:
end
end
-- fix for trailing br tags passed through [[template:marriage]]
-- fix for trailing br tags passed through [[template:marriage]]
-- Frietjes fix: should we use it? comment out for now
s = mw.ustring.gsub(s, '<%s*br[^>]*>%s*(</div>)', '%1')
-- s = mw.ustring.gsub(s, '<%s*br[^>]*>%s*(</div>)', '%1')
-- replace all wikilinks with fixed string
-- replace all wikilinks with fixed string
if rewriteLinks then
if rewriteLinks then