mirror of
https://github.com/russross/blackfriday.git
synced 2024-03-22 13:40:34 +08:00
Correctly emit trailing header ID brace
This commit is contained in:
parent
cf01a94556
commit
7ad5f9c119
1
block.go
1
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] == '#' {
|
||||
|
|
|
@ -191,6 +191,12 @@ func TestPrefixHeaderIdExtension(t *testing.T) {
|
|||
"# Header 1 {#someid\n",
|
||||
"<h1>Header 1 {#someid</h1>\n",
|
||||
|
||||
"# Header 1 {#someid\n",
|
||||
"<h1>Header 1 {#someid</h1>\n",
|
||||
|
||||
"# Header 1 {#someid}}\n",
|
||||
"<h1 id=\"someid\">Header 1</h1>\n\n<p>}</p>\n",
|
||||
|
||||
"## Header 2 {#someid}\n",
|
||||
"<h2 id=\"someid\">Header 2</h2>\n",
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user