mirror of
https://github.com/schollz/cowyo.git
synced 2023-08-10 21:13:00 +03:00
Math works now
This commit is contained in:
@ -67,11 +67,11 @@ func renderMarkdown(c *gin.Context, title string) {
|
||||
|
||||
r, _ := regexp.Compile("\\$\\$(.*?)\\$\\$")
|
||||
for _, s := range r.FindAllString(html2, -1) {
|
||||
html2 = strings.Replace(html2, s, "<div class='texp' data-expr='"+s[2:len(s)-2]+"'></div>", 1)
|
||||
html2 = strings.Replace(html2, s, "<span class='texp' data-expr='"+s[2:len(s)-2]+"'></span>", 1)
|
||||
}
|
||||
r, _ = regexp.Compile("\\$(.*?)\\$")
|
||||
for _, s := range r.FindAllString(html2, -1) {
|
||||
html2 = strings.Replace(html2, s, "<div class='texi' data-expr='"+s[1:len(s)-1]+"'></div>", 1)
|
||||
html2 = strings.Replace(html2, s, "<span class='texi' data-expr='"+s[1:len(s)-1]+"'></span>", 1)
|
||||
}
|
||||
|
||||
c.HTML(http.StatusOK, "view.tmpl", gin.H{
|
||||
|
Reference in New Issue
Block a user