diff --git a/org/block.go b/org/block.go index 6f8a98f..11b135f 100644 --- a/org/block.go +++ b/org/block.go @@ -105,6 +105,9 @@ func (d *Document) parseExample(i int, parentStop stopFn) (int, Node) { } func (d *Document) parseResult(i int, parentStop stopFn) (int, Node) { + if i+1 >= len(d.tokens) { + return 0, nil + } consumed, node := d.parseOne(i+1, parentStop) return consumed + 1, Result{node} }