From 5b5f607eb52af3c9d3c00d4c0ee347861666e3bb Mon Sep 17 00:00:00 2001 From: Umputun Date: Sun, 6 May 2018 17:07:13 -0500 Subject: [PATCH] allow common md extensions --- app/rest/api/rest.go | 4 ++-- remark.rest | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/rest/api/rest.go b/app/rest/api/rest.go index 426d636b..130d01e1 100644 --- a/app/rest/api/rest.go +++ b/app/rest/api/rest.go @@ -134,7 +134,7 @@ func (s *Rest) createCommentCtrl(w http.ResponseWriter, r *http.Request) { comment.PrepareUntrusted() // clean all fields user not suppoed to set comment.User = user comment.User.IP = strings.Split(r.RemoteAddr, ":")[0] - comment.Text = string(blackfriday.Run([]byte(comment.Text), blackfriday.WithNoExtensions())) // render markdown + comment.Text = string(blackfriday.Run([]byte(comment.Text), blackfriday.CommonExtensions) // render markdown log.Printf("[DEBUG] create comment %+v", comment) // check if user blocked @@ -160,7 +160,7 @@ func (s *Rest) previewCommentCtrl(w http.ResponseWriter, r *http.Request) { rest.SendErrorJSON(w, r, http.StatusBadRequest, err, "can't bind comment") return } - comment.Text = string(blackfriday.Run([]byte(comment.Text), blackfriday.WithNoExtensions())) + comment.Text = string(blackfriday.Run([]byte(comment.Text), blackfriday.CommonExtensions) render.HTML(w, r, comment.Text) } diff --git a/remark.rest b/remark.rest index ecc1b601..b49a1df0 100644 --- a/remark.rest +++ b/remark.rest @@ -1,6 +1,6 @@ ### find request with tree -GET {{host}}/api/v1/find?site=remark&sort=+score&format=tree&url=https://radio-t.com/p/2017/12/16/podcast-576/ +GET {{host}}/api/v1/find?site=remark&sort=-score&format=tree&url=https://radio-t.com/p/2017/12/16/podcast-576/ ### find request with plain GET {{host}}/api/v1/find?site=remark&sort=-score&format=plain&url=https://radio-t.com/p/2017/12/16/podcast-576/