Modul:Detect singular: Unterschied zwischen den Versionen
isolated commas can trigger plural also
(more specific match on and) |
(isolated commas can trigger plural also) |
||
Zeile 38: | Zeile 38: | ||
-- replace all wikilinks with fixed string | -- replace all wikilinks with fixed string | ||
s = mw.ustring.gsub(s,'%b[]','WIKILINK') | s = mw.ustring.gsub(s,'%b[]','WIKILINK') | ||
local hasComma = checkComma and mw.ustring.find(s, '%a,%s') | local hasComma = checkComma and mw.ustring.find(s, '[%a%s],%s') | ||
local hasAnd = mw.ustring.find(s,'[,%s]and%s') | local hasAnd = mw.ustring.find(s,'[,%s]and%s') | ||
local hasBreak = mw.ustring.find(s,'<%s*br') | local hasBreak = mw.ustring.find(s,'<%s*br') |