From 81026648f72b3e17a3a1259f9e1a7865baf83bbe Mon Sep 17 00:00:00 2001 From: facundo Date: Sat, 6 Jul 2024 14:28:34 -0300 Subject: [PATCH] allow to escape smartify quote replacements --- markup/smartify.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/markup/smartify.go b/markup/smartify.go index 74ff417..9e8c3dc 100644 --- a/markup/smartify.go +++ b/markup/smartify.go @@ -55,6 +55,8 @@ var smartifyTransforms = []struct { {regexp.MustCompile(`'`), "’"}, {regexp.MustCompile(`(^|[^[:alnum:]])"`), "$1“"}, {regexp.MustCompile(`"($|[^[:alnum:]])`), "”$1"}, + {regexp.MustCompile(`\\[‘’]`), "'"}, // undo backslashed replacements + {regexp.MustCompile(`\\[“”]`), `"`}, // undo backslashed replacements } var smartifyReplacer *strings.Replacer