export req less
parent
4d076ede3d
commit
a26d34c2b3
|
|
@ -27,7 +27,7 @@ func (n *Notes) File(urlPath string) (string, error) {
|
||||||
return "", errors.New("path is dir")
|
return "", errors.New("path is dir")
|
||||||
}
|
}
|
||||||
b, _ := ioutil.ReadFile(p.Local)
|
b, _ := ioutil.ReadFile(p.Local)
|
||||||
return n.Gomarkdown(urlPath, b)
|
return n.gomarkdown(urlPath, b)
|
||||||
return n.blackfriday(urlPath, b)
|
return n.blackfriday(urlPath, b)
|
||||||
return n.goldmark(urlPath, b)
|
return n.goldmark(urlPath, b)
|
||||||
return n.md2min(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
|
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{
|
renderer := html.NewRenderer(html.RendererOptions{
|
||||||
Flags: html.CommonFlags | html.TOC,
|
Flags: html.CommonFlags | html.TOC,
|
||||||
RenderNodeHook: n.commentFormer(urlPath, b),
|
RenderNodeHook: renderHook,
|
||||||
})
|
})
|
||||||
ext := parser.NoExtensions
|
ext := parser.NoExtensions
|
||||||
for _, extension := range []parser.Extensions{
|
for _, extension := range []parser.Extensions{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue