mirror of https://github.com/jlelse/GoBlog
Code highlighting in editor preview as well
This commit is contained in:
parent
0414d2fe85
commit
1aa2a8f655
|
@ -12,7 +12,6 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/gorilla/websocket"
|
"github.com/gorilla/websocket"
|
||||||
"github.com/microcosm-cc/bluemonday"
|
|
||||||
"go.goblog.app/app/pkgs/contenttype"
|
"go.goblog.app/app/pkgs/contenttype"
|
||||||
"gopkg.in/yaml.v3"
|
"gopkg.in/yaml.v3"
|
||||||
)
|
)
|
||||||
|
@ -86,8 +85,6 @@ func (a *goBlog) createMarkdownPreview(blog string, markdown []byte) (rendered [
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
// Sanitize HTML
|
|
||||||
rendered = bluemonday.UGCPolicy().SanitizeBytes(rendered)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
{{ define "title" }}
|
{{ define "title" }}
|
||||||
|
<link rel="stylesheet" href="{{ asset "css/chroma.css" }}">
|
||||||
<title>{{ string .Blog.Lang "editor" }} - {{ mdtitle .Blog.Title }}</title>
|
<title>{{ string .Blog.Lang "editor" }} - {{ mdtitle .Blog.Title }}</title>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue