[codegen/schema] Skip processing a line if the block position is greater than the length of the line.
@@ -133,10 +133,12 @@ func (p shortcodeParser) Open(parent ast.Node, reader text.Reader, pc parser.Con
}
func (p shortcodeParser) Continue(node ast.Node, reader text.Reader, pc parser.Context) parser.State {
- line, _ := reader.PeekLine()
+ line, seg := reader.PeekLine()
pos := pc.BlockOffset()
if pos < 0 {
return parser.Continue | parser.HasChildren
+ } else if pos > seg.Len() {
+ return parser.Continue | parser.HasChildren
}
nameStart, nameEnd, shortcodeEnd, isClose, ok := p.parseShortcode(line, pos)
