aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/templates/helper.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/templates/helper.go b/modules/templates/helper.go
index 63c165bc8b..918a6523ba 100644
--- a/modules/templates/helper.go
+++ b/modules/templates/helper.go
@@ -632,6 +632,11 @@ func JSEscape(raw string) string {
return template.JSEscapeString(raw)
}
+// DotEscape wraps a dots in names with ZWJ [U+200D] in order to prevent autolinkers from detecting these as urls
+func DotEscape(raw string) string {
+ return strings.ReplaceAll(raw, ".", "\u200d.\u200d")
+}
+
// Sha1 returns sha1 sum of string
func Sha1(str string) string {
return base.EncodeSha1(str)