From 47a3653d619f0d1268c098af0bb23161ea2b470e Mon Sep 17 00:00:00 2001 From: Niklas Fasching Date: Fri, 17 Apr 2020 15:39:43 +0200 Subject: [PATCH] Fix inline src index off by one thank god for fuzzing --- org/inline.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org/inline.go b/org/inline.go index aeebb5b..566af0f 100644 --- a/org/inline.go +++ b/org/inline.go @@ -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