revert bfchroma md render, need some sanitizer exceptions
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user