export req less

master
Bel LaPointe 2020-09-28 10:05:11 -06:00
parent 4d076ede3d
commit a26d34c2b3
1 changed files with 7 additions and 3 deletions

View File

@ -27,7 +27,7 @@ func (n *Notes) File(urlPath string) (string, error) {
return "", errors.New("path is dir")
}
b, _ := ioutil.ReadFile(p.Local)
return n.Gomarkdown(urlPath, b)
return n.gomarkdown(urlPath, b)
return n.blackfriday(urlPath, b)
return n.goldmark(urlPath, b)
return n.md2min(urlPath, b)
@ -56,10 +56,14 @@ func (n *Notes) md2min(urlPath string, b []byte) (string, error) {
return string(buff.Bytes()), err
}
func (n *Notes) Gomarkdown(urlPath string, b []byte) (string, error) {
func (n *Notes) gomarkdown(urlPath string, b []byte) (string, error) {
return Gomarkdown(b, n.commentFormer(urlPath, b))
}
func Gomarkdown(b []byte, renderHook html.RenderNodeFunc) (string, error) {
renderer := html.NewRenderer(html.RendererOptions{
Flags: html.CommonFlags | html.TOC,
RenderNodeHook: n.commentFormer(urlPath, b),
RenderNodeHook: renderHook,
})
ext := parser.NoExtensions
for _, extension := range []parser.Extensions{