Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code blocks not parsed correctly #715

Open
simonasGit opened this issue Sep 28, 2023 · 0 comments
Open

Code blocks not parsed correctly #715

simonasGit opened this issue Sep 28, 2023 · 0 comments

Comments

@simonasGit
Copy link

simonasGit commented Sep 28, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant