-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[BUG] Incorrect ordering of markdown elements #1036
Comments
Could be a bug in commonmark lib. But equally likely to be in Rich. Strange one though. What happens if you put an extra blank line after the list? |
Same result with extra blank line. The following: This is a test.
1. first item
2. second item
item
code block
Normal text yields
Leaving the last line ( |
Hi André, Looks like this is a bug in commonmark, but it's a weird one. The HTML output from commonmark appears to work, i.e. the code block is after the list, where you would expect. But looking at the HTML source, I can see the code block is inside the second list item, which is incorrect. The browser is fixing that because block level elements shouldn't go inside I think this explains why the developers never saw it, because the output in the browser looks fine. I'll report that upstream, and hopefully they will fix it there. BTW, thanks for the ko-fi! |
Understanding this a bit more. Tested with https://spec.commonmark.org/dingus/ and I now realise that the code block should go in side the second item of the list. The commonmark lib does generate the correct HTML, so I'm not sure why the order is wrong in Rich. |
Think I have a fix. Please try 9.12.0 |
It works with my test file, thanks. |
Read the docs
I didn't see this bug mentioned ... nor would I expect you not to know about it and not fix it! ;-)
Describe the bug
When a markdown file contains a indented block after an itemized list, the content of the indented block is shown before the itemized list.
To Reproduce
A minimal code example that reproduces the problem would be a big help if you can provide it. If the issue is visual in nature, consider posting a screenshot.
Here's the content of a simple markdown file:
Here is how Rich renders it:
Platform
Windows, Windows terminal
Diagnose
I may ask you to cut and paste the output of the following commands. It may save some time if you do it now.
Did I help?
If I was able to resolve your problem, consider sponsoring my work on Rich, or buy me a coffee to say thanks.
The text was updated successfully, but these errors were encountered: