only need to dupe string for zalgo if zerowidth present
This commit is contained in:
parent
dd522b8243
commit
49d1574575
|
@ -70,8 +70,17 @@ func unpucker(s string) string {
|
||||||
return string(x)
|
return string(x)
|
||||||
}
|
}
|
||||||
s = re_alltheshitz.ReplaceAllStringFunc(s, fixer)
|
s = re_alltheshitz.ReplaceAllStringFunc(s, fixer)
|
||||||
x := make([]byte, 0, len(s))
|
|
||||||
zw := false
|
zw := false
|
||||||
|
for _, c := range s {
|
||||||
|
if runewidth.RuneWidth(c) == 0 {
|
||||||
|
zw = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if zw {
|
||||||
|
x := make([]byte, 0, len(s))
|
||||||
|
zw = false
|
||||||
for _, c := range s {
|
for _, c := range s {
|
||||||
if runewidth.RuneWidth(c) == 0 {
|
if runewidth.RuneWidth(c) == 0 {
|
||||||
if zw {
|
if zw {
|
||||||
|
@ -86,3 +95,5 @@ func unpucker(s string) string {
|
||||||
}
|
}
|
||||||
return string(x)
|
return string(x)
|
||||||
}
|
}
|
||||||
|
return s
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue