mirror of
https://github.com/twisterarmy/twister-calm.git
synced 2025-03-13 05:51:07 +00:00
require smiles to be whitespace-surrounded
This commit is contained in:
parent
e2862cf7eb
commit
2478c09ec3
@ -81,15 +81,10 @@
|
||||
var rep = $s.replacement
|
||||
.replace(/\{eId\}/g, $s.map[pattern]);
|
||||
|
||||
if (pattern[0] === ';') {
|
||||
text = text
|
||||
.replace(new RegExp("(^|\\W)" + $t.quote(pattern), "g"), "$1" + rep)
|
||||
.replace(new RegExp("(^|\\W)" + $t.quote(encPattent), "g"), "$1" + rep);
|
||||
} else {
|
||||
text = text
|
||||
.replace(new RegExp($t.quote(pattern), "g"), rep)
|
||||
.replace(new RegExp($t.quote(encPattent), "g"), rep);
|
||||
}
|
||||
text = text.replace(
|
||||
new RegExp("(^|\\s)(" + $t.quote(pattern) + "|" + $t.quote(encPattent) + ")(?=\\s|$)", "g"),
|
||||
"$1" + rep
|
||||
);
|
||||
}
|
||||
|
||||
return text;
|
||||
|
Loading…
x
Reference in New Issue
Block a user