Closed cyrus-and closed 2 years ago
Just ran into this myself while writing unit tests for my markdown renderer for goldmark.
I've narrowed it down to the following conditions:
I believe this is caused by an off-by-one error in advancing the source when parsing an HTML block on the last line of the document. It advances up to but not including the final character >
, before closing the HTML block node. The parser continues parsing >
as another block, generating an empty blockquote node in the process.
Until this is fixed, one can prevent this bug by always ensuring that your markdown document ends with a trailing newline before sending it to goldmark for parsing. It's good unix practice anyway.
@yuin Ran into the same issue but with pure html
md file with raw html
<pre>
hello
<code>
some code
<code>
<pre>
Receiving at the end "blockquote" tags
Maybe I did not understand how I should workaround it, did not find nothing within the renderer options
It's possible this has something to do with the fact that there's no closing tags in your HTML example.
Can you post the output of calling ast.Dump
on the parsed source?
What did you do?
or
or an empty output, certainly not a
<blockquote>
tag.