Skip to content

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

Description

@DarrenXu94

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    L2 - annoyingSimilar to L1 - broken but there is a known workaround available for the issuecategory: lists

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions