diff --git a/routes.go b/routes.go index a752bac..f57ee92 100644 --- a/routes.go +++ b/routes.go @@ -65,9 +65,13 @@ func renderMarkdown(c *gin.Context, title string) { html := bluemonday.UGCPolicy().SanitizeBytes(unsafe) html2 := string(html) - r, _ := regexp.Compile("\\$(.*?)\\$") + r, _ := regexp.Compile("\\$\\$(.*?)\\$\\$") for _, s := range r.FindAllString(html2, -1) { - html2 = strings.Replace(html2, s, "
", 1) + html2 = strings.Replace(html2, s, "
", 1) + } + r, _ = regexp.Compile("\\$(.*?)\\$") + for _, s := range r.FindAllString(html2, -1) { + html2 = strings.Replace(html2, s, "
", 1) } c.HTML(http.StatusOK, "view.tmpl", gin.H{ diff --git a/templates/view.tmpl b/templates/view.tmpl index ec58ce5..7ccefe7 100644 --- a/templates/view.tmpl +++ b/templates/view.tmpl @@ -45,9 +45,14 @@