mirror of
https://github.com/rystaf/mlmym.git
synced 2024-11-09 16:55:17 +00:00
dont escape html, gets messy with code blocks
This commit is contained in:
parent
f95ae87385
commit
9de5ccb07f
|
@ -7,7 +7,6 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"html"
|
|
||||||
"html/template"
|
"html/template"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
@ -152,8 +151,6 @@ var funcMap = template.FuncMap{
|
||||||
body = re.ReplaceAllString(body, "\n***\n")
|
body = re.ReplaceAllString(body, "\n***\n")
|
||||||
// community bangs
|
// community bangs
|
||||||
body = RegReplace(body, `([^\[])!([a-zA-Z0-9_]+)@([a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]+)+)`, `$1[!$2@$3](/c/$2@$3)`)
|
body = RegReplace(body, `([^\[])!([a-zA-Z0-9_]+)@([a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]+)+)`, `$1[!$2@$3](/c/$2@$3)`)
|
||||||
// escape HTML tags
|
|
||||||
body = html.EscapeString(body)
|
|
||||||
if err := md.Convert([]byte(body), &buf); err != nil {
|
if err := md.Convert([]byte(body), &buf); err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
return template.HTML(body)
|
return template.HTML(body)
|
||||||
|
|
Loading…
Reference in a new issue