diff --git a/block.go b/block.go index e73cf02..2069163 100644 --- a/block.go +++ b/block.go @@ -196,6 +196,7 @@ func (p *parser) prefixHeader(out *bytes.Buffer, data []byte) int { if j < end && k < end { id = string(data[j+2:k]) end = j + skip = k + 1 } } for end > 0 && data[end-1] == '#' { diff --git a/block_test.go b/block_test.go index 20f29a1..fc03836 100644 --- a/block_test.go +++ b/block_test.go @@ -191,6 +191,12 @@ func TestPrefixHeaderIdExtension(t *testing.T) { "# Header 1 {#someid\n", "

Header 1 {#someid

\n", + "# Header 1 {#someid\n", + "

Header 1 {#someid

\n", + + "# Header 1 {#someid}}\n", + "

Header 1

\n\n

}

\n", + "## Header 2 {#someid}\n", "

Header 2

\n",