allow to escape smartify quote replacements
Some checks failed
Test project / build (push) Has been cancelled

This commit is contained in:
facundo 2024-07-06 14:28:34 -03:00
parent 353eba4196
commit 81026648f7

View file

@ -55,6 +55,8 @@ var smartifyTransforms = []struct {
{regexp.MustCompile(`'`), ""}, {regexp.MustCompile(`'`), ""},
{regexp.MustCompile(`(^|[^[:alnum:]])"`), "$1“"}, {regexp.MustCompile(`(^|[^[:alnum:]])"`), "$1“"},
{regexp.MustCompile(`"($|[^[:alnum:]])`), "”$1"}, {regexp.MustCompile(`"($|[^[:alnum:]])`), "”$1"},
{regexp.MustCompile(`\\[]`), "'"}, // undo backslashed replacements
{regexp.MustCompile(`\\[“”]`), `"`}, // undo backslashed replacements
} }
var smartifyReplacer *strings.Replacer var smartifyReplacer *strings.Replacer