diff --git a/notes/file.go b/notes/file.go index 1d9d92a..e27437e 100755 --- a/notes/file.go +++ b/notes/file.go @@ -68,7 +68,7 @@ func (n *Notes) commentFormer(urlPath string, md []byte) html.RenderNodeFunc { cur++ for cur < len(lines) { for _, opener_closer := range [][]string{{"```", "```"}, {``, ``}} { - if bytes.Contains(lines[cur], []byte(opener_closer[0])) { + if cur < len(lines) && bytes.Contains(lines[cur], []byte(opener_closer[0])) { cur++ for cur < len(lines) && !bytes.Contains(lines[cur], []byte(opener_closer[1])) { cur++