Modul:Detect singular: Unterschied zwischen den Versionen
(simplify logic a bit) |
(more specific match on and) |
||
Zeile 39: | Zeile 39: | ||
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') | ||
local hasAnd = mw.ustring.find(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') | ||
local hasBullets = checkBullets and countMatches(s,'%*+') > 1 | local hasBullets = checkBullets and countMatches(s,'%*+') > 1 |