diff --git a/notes/file.go b/notes/file.go index c75b2b8..630589e 100755 --- a/notes/file.go +++ b/notes/file.go @@ -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,7 +56,7 @@ 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) { renderer := html.NewRenderer(html.RendererOptions{ Flags: html.CommonFlags | html.TOC, RenderNodeHook: n.commentFormer(urlPath, b), @@ -115,7 +115,7 @@ func (n *Notes) commentFormer(urlPath string, md []byte) html.RenderNodeFunc { } } return func(w io.Writer, node ast.Node, entering bool) (ast.WalkStatus, bool) { - if heading, ok := node.(*ast.Heading); !n.ro && ok && !entering { + if heading, ok := node.(*ast.Heading); !n.RO && ok && !entering { nextHeader() fmt.Fprintf(w, `