blackfriday
blackfriday copied to clipboard
Code blocks not parsed correctly
The text:
- dir1
- [title](url)
- dir2
- something
- [hello](http://)
#1tag1 #tag2
```markdown
# some text
'bout sumthin'
[f](http://ecosia.org)
```
- [hello](url)
#tag1 #tag2
- [hello](url)
#tag1 #tag2
The code:
package main
import (
"fmt"
"os"
"github.com/russross/blackfriday/v2"
)
var data, _ = os.ReadFile("the text above")
func main() {
p := blackfriday.New(blackfriday.WithExtensions(blackfriday.FencedCode))
rootList := p.Parse([]byte(data)).FirstChild
fmt.Printf("%s", rootList.FirstChild.Next.Next.Next)
}
Output:
(*blackfriday.Node)(nil)
For some reason the list is parsed with the first 3 items as children, and the other 2 as children of a list under the - [hello](http://) item. I assume something's wrong with the way code blocks are parsed in a list?
Edit: issue is caused when language is specified.
I see the same issue. When specifying the block info it breaks parsing.