revert bfchroma md render, need some sanitizer exceptions

This commit is contained in:
Umputun
2018-05-13 14:13:37 -05:00
parent 5056b2a1a2
commit 8e810cc9d2
2 changed files with 4 additions and 5 deletions
+3 -4
View File
@@ -12,7 +12,6 @@ import (
"strings"
"time"
"github.com/Depado/bfchroma"
"github.com/didip/tollbooth"
"github.com/didip/tollbooth_chi"
"github.com/go-chi/chi"
@@ -184,9 +183,9 @@ func (s *Rest) previewCommentCtrl(w http.ResponseWriter, r *http.Request) {
return
}
comment.Text = string(blackfriday.Run([]byte(comment.Text),
blackfriday.WithRenderer(bfchroma.NewRenderer(bfchroma.WithoutAutodetect()))))
//comment.Text = string(blackfriday.Run([]byte(comment.Text), blackfriday.WithExtensions(mdExt)))
//comment.Text = string(blackfriday.Run([]byte(comment.Text),
// blackfriday.WithRenderer(bfchroma.NewRenderer(bfchroma.WithoutAutodetect()))))
comment.Text = string(blackfriday.Run([]byte(comment.Text), blackfriday.WithExtensions(mdExt)))
comment.Sanitize()
render.HTML(w, r, comment.Text)
}
+1 -1
View File
@@ -91,7 +91,7 @@ func TestServer_Preview(t *testing.T) {
assert.Equal(t, "<p>test 123</p>\n", string(b))
}
func _TestServer_PreviewWithMD(t *testing.T) {
func TestServer_PreviewWithMD(t *testing.T) {
srv, port := prep(t)
require.NotNil(t, srv)
defer cleanup(srv)