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

HTML tag immediately after list item, bug or working as expected? #3437

Closed
DarrenXu94 opened this issue Aug 30, 2024 · 1 comment · Fixed by #3444
Closed

HTML tag immediately after list item, bug or working as expected? #3437

DarrenXu94 opened this issue Aug 30, 2024 · 1 comment · Fixed by #3444
Labels
category: lists L2 - annoying Similar to L1 - broken but there is a known workaround available for the issue

Comments

@DarrenXu94
Copy link

Marked version:
14

Describe the bug
When using a html tag immediately after a list item without a new line, the rendered HTML is invalid

To Reproduce
marked demo

- list item
- list item
<div class="some-class">

Content

</div>
- list item

generates

<ul>
<li>list item</li>
<li>list item<div class="some-class"></li>
</ul>
<p>Content</p>
</div>
- list item

As you can see here the <div> tag is closed by the </li> before the closing div tag

Expected behavior
Here is a demo from the marked-it lib. Still doesn't do everything perfectly but at least generates valid html?

marked-it demo

@UziTech
Copy link
Member

UziTech commented Aug 31, 2024

This doesn't follow the common mark demo which is what we should be following. But honestly that is just really bad markdown so I am going to say that falls under garbage in garbage out.

@UziTech UziTech added L2 - annoying Similar to L1 - broken but there is a known workaround available for the issue category: lists labels Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: lists L2 - annoying Similar to L1 - broken but there is a known workaround available for the issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants