-
Notifications
You must be signed in to change notification settings - Fork 180
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
Bad parsing of code block inside quotes followed by a code block #325
Comments
Please see the attached file |
I think my issue is related. A code block is causing a indefinite loop. This minimal reproduction of the issue. https://goplay.tools/snippet/JQkkXK22Y2S package main
import "github.com/gomarkdown/markdown"
func main() {
html := markdown.ToHTML([]byte("```\n: "), nil, nil)
print(html)
} |
@unix-world can you check using latest master? If it still doesn't work, please:
|
I will attach you the test Markdown I have, I cannot use the online playground because the markdown contains both " and ` and is too complicate to escape them, so the content is within a file ... PS: if you look in the previous message screenshots it has to do with a fenced code inside a blockquote. |
It's way too big. If you can't reduce repro to less than 5 lines, I'm not going to wade through hundreds of lines trying to guess which part you think is parsed wrong. I need:
|
I just isolated the case, this part of the code is rendered wrong, as you can see in the screenshots I atatched you in the previous message. Looks like if I put a fenced code block inside a quoted block and after, somewhere below another fenced block will have this issue. |
See the attachments... |
I got a fix for this issue, in the file parser/block.go
|
Can you confirm that this is the minimized repro:
It generates a single code block inside a blockquote. It should generate 3 code blocks, one inside blockquote. Other cases:
The simplest case is really:
The last |
Just removing fence code logic inside |
The problem is that Another case:
On babelmark those generate blockqote with codeblock, paragraph for "// comment" and another codeblock. We have very uncommon interpretation of this as a single code block inside blockquote. But this logic breaks when there's a code block after blockquote. We probably could fix this case without breaking those other test cases. |
Test
ok
ok
Quote break.
Preformatted blocks are useful for ASCII art:
END
The text was updated successfully, but these errors were encountered: