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

<table> improperly wrapped by <p> when inside a list #1445

Closed
socram8888 opened this issue Feb 24, 2024 · 1 comment
Closed

<table> improperly wrapped by <p> when inside a list #1445

socram8888 opened this issue Feb 24, 2024 · 1 comment
Labels
3rd-party Should be implemented as a third party extension. wontfix The issue will not be fixed for the stated reasons.

Comments

@socram8888
Copy link

socram8888 commented Feb 24, 2024

When a <table> element is specified inside a list, it gets improperly wrapped with a <p>:

import markdown
html = markdown.markdown("""
  - List element
    
    <table></table>
""")
print(html)

Returns:

<ul>
<li>
<p>List element</p>
<p><table></table></p>
</li>
</ul>

This is not correct - tables are not allowed inside paragraph elements. What should be generated is:

<ul>
<li>
<p>List element</p>
<table></table>
</li>
</ul>
@waylan
Copy link
Member

waylan commented Feb 26, 2024

Please note that the syntax rules state regarding raw HTML:

The only restrictions are that block-level HTML elements — e.g. <div>, <table>, <pre>, <p>, etc. — must be separated from surrounding content by blank lines, and the start and end tags of the block should not be indented with tabs or spaces.

Of course, if they cannot be indented, then they cannot be nested inside list items. In fact, this same limitation exists in the reference implementation. We have no plans to change this behavior. However, one is certainly free to develop their own third-party extension which behaves differently.

@waylan waylan closed this as not planned Won't fix, can't repro, duplicate, stale Feb 26, 2024
@waylan waylan added wontfix The issue will not be fixed for the stated reasons. 3rd-party Should be implemented as a third party extension. labels Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3rd-party Should be implemented as a third party extension. wontfix The issue will not be fixed for the stated reasons.
Projects
None yet
Development

No branches or pull requests

2 participants