From 1b8f7f86f4874f8c6cf3973dcea8846a84dab468 Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Mon, 29 Mar 2021 07:59:29 -0500 Subject: [PATCH] out of bounds --- notes/file.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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++