out of bounds

master
Bel LaPointe 2021-03-29 07:59:29 -05:00
parent 6ea5f2c675
commit 1b8f7f86f4
1 changed files with 1 additions and 1 deletions

View File

@ -68,7 +68,7 @@ func (n *Notes) commentFormer(urlPath string, md []byte) html.RenderNodeFunc {
cur++
for cur < len(lines) {
for _, opener_closer := range [][]string{{"```", "```"}, {`<summary>`, `</summary>`}} {
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++