Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.
Go dockerfossgomarkdownmemomicroblognote-takingnotesopen-sourceown-your-datareactself-hostedsqlitetimeline
feat: parse markdown to html format in rss (#1683)
boojackd80aa67c9703
diff --git a/go.mod b/go.modindex eee62b812..69f6854f2 100644--- a/go.mod+++ b/go.mod@@ -17,6 +17,7 @@ require (github.com/spf13/cobra v1.6.1github.com/spf13/viper v1.15.0github.com/stretchr/testify v1.8.1+ github.com/yuin/goldmark v1.5.4go.uber.org/zap v1.24.0golang.org/x/crypto v0.1.0golang.org/x/exp v0.0.0-20230111222715-75897c7a292adiff --git a/go.sum b/go.sumindex 20796ee6d..ce2011dfb 100644--- a/go.sum+++ b/go.sum@@ -262,6 +262,8 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9degithub.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=+github.com/yuin/goldmark v1.5.4 h1:2uY/xC0roWy8IBEGLgB1ywIoEJFGmRrX21YQcvGZzjU=+github.com/yuin/goldmark v1.5.4/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=diff --git a/server/rss.go b/server/rss.goindex 18b8b66ce..6437e59d6 100644--- a/server/rss.go+++ b/server/rss.go@@ -1,6 +1,7 @@package serverimport (+ "bytes""context""encoding/json""net/http"@@ -12,6 +13,7 @@ import ("github.com/labstack/echo/v4""github.com/usememos/memos/api""github.com/usememos/memos/common"+ "github.com/yuin/goldmark")func (s *Server) registerRSSRoutes(g *echo.Group) {@@ -169,7 +171,13 @@ func getRSSItemDescription(content string) string {} else {description = content}- return description++ // TODO: use our `./plugin/gomark` parser to handle markdown-like content.+ var buf bytes.Buffer+ if err := goldmark.Convert([]byte(description), &buf); err != nil {+ panic(err)+ }+ return buf.String()}func isTitleDefined(content string) bool {