Skip to content

Commit

Permalink
Fix inline src index off by one
Browse files Browse the repository at this point in the history
thank god for fuzzing
  • Loading branch information
niklasfasching committed Apr 17, 2020
1 parent 7e69931 commit 47a3653
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion org/inline.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func (d *Document) parseInlineBlock(input string, start int) (int, int, Node) {
if !(strings.HasSuffix(input[:start], "src") && (start-4 < 0 || unicode.IsSpace(rune(input[start-4])))) {
return 0, 0, nil
}
if m := inlineBlockRegexp.FindStringSubmatch(input[start-4:]); m != nil {
if m := inlineBlockRegexp.FindStringSubmatch(input[start-3:]); m != nil {
return 3, len(m[0]), InlineBlock{"src", strings.Fields(m[1] + " " + m[3]), d.parseRawInline(m[4])}
}
return 0, 0, nil
Expand Down

0 comments on commit 47a3653

Please sign in to comment.