summaryrefslogtreecommitdiffstats
path: root/utils.go
diff options
context:
space:
mode:
Diffstat (limited to 'utils.go')
-rw-r--r--utils.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils.go b/utils.go
index d4c078f..33c9278 100644
--- a/utils.go
+++ b/utils.go
@@ -158,6 +158,8 @@ func squeezeSpaces(s string) string {
return buf.String()
}
+var replacer = strings.NewReplacer("---", "—", "--", "–", "~", "\u00A0", "``", "“", "''", "”", "'", "’", "\"", "”")
+
func UnTex(s string) string {
r := newReader(s)
var buf bytes.Buffer
@@ -183,8 +185,6 @@ func UnTex(s string) string {
}
s = string(norm.NFC.Bytes(buf.Bytes()))
s = squeezeSpaces(s)
- replacer := strings.NewReplacer("---", "—", "--", "–", "~", "\u00A0",
- "``", "“", "''", "”", "'", "’", "\"", "”")
return replacer.Replace(s)
}