diff --git a/inline.go b/inline.go index f76d7b3..fe45aa0 100644 --- a/inline.go +++ b/inline.go @@ -348,7 +348,7 @@ func link(p *parser, out *bytes.Buffer, data []byte, offset int) int { i++ // reference style link - case i < len(data) && data[i] == '[': + case i < len(data)-1 && data[i] == '[' && data[i+1] != '^': var id []byte // look for the id diff --git a/inline_test.go b/inline_test.go index c07ecdc..bf362e0 100644 --- a/inline_test.go +++ b/inline_test.go @@ -805,6 +805,12 @@ what happens here "empty footnote[^]\n\n[^]: fn text", "
empty footnote1
\nSome text.1
\n