feat: parse markdown to html format in rss (#1683)

This commit is contained in:
boojack
2023-05-20 10:00:21 +08:00
committed by GitHub
parent ae1d9adf65
commit d80aa67c97
3 changed files with 12 additions and 1 deletions

View File

@ -1,6 +1,7 @@
package server
import (
"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 {