We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It expects an empty line between a header and a list when parsing. This code is parsed well:
# Header1 * list item # Header2
this is wrong (header is interpreted as a list item):
But when rendering, the render doesn't put this blank line.
Thus, let say, you have AST like this:
Heading Text 'Header1' List 'tight flags=start' ListItem 'flags=start end' Paragraph Text 'list item' Heading Text 'Header2'
if you render it and parse the result, it will be different:
Heading Text 'Header1' List 'flags=start' ListItem 'flags=has_block start' Paragraph Text 'list item' Heading Text 'Header2
Here is the test:
package md import ( "github.com/gomarkdown/markdown" "github.com/gomarkdown/markdown/md" "github.com/gomarkdown/markdown/parser" "github.com/stretchr/testify/require" "testing" ) func Test_mdHeaderRendering(t *testing.T) { r := require.New(t) inMd := `# Header1 * list item # Header2 ` p := parser.NewWithExtensions(parser.CommonExtensions) doc1 := p.Parse([]byte(inMd)) outMd := string(markdown.Render(doc1, md.NewRenderer())) t.Log("original MD:\n", inMd) t.Log("MD after serialization/deserialization:\n", outMd) p = parser.NewWithExtensions(parser.CommonExtensions) doc2 := p.Parse([]byte(outMd)) r.Equal(len(doc1.GetChildren()), len(doc2.GetChildren())) }
I don't know whether the renderer or the parser has a bug, but this behavior is inconsistent
The text was updated successfully, but these errors were encountered:
Looks like list is parsed when it starts from the new paragraph. If not, list not parsed correctly.
Sorry, something went wrong.
No branches or pull requests
It expects an empty line between a header and a list when parsing.
This code is parsed well:
this is wrong (header is interpreted as a list item):
But when rendering, the render doesn't put this blank line.
Thus, let say, you have AST like this:
if you render it and parse the result, it will be different:
Here is the test:
I don't know whether the renderer or the parser has a bug, but this behavior is inconsistent
The text was updated successfully, but these errors were encountered: