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

🐛 BUG: Nesting inside <p> tags #432

Open
gloopsies opened this issue Jun 16, 2022 · 3 comments
Open

🐛 BUG: Nesting inside <p> tags #432

gloopsies opened this issue Jun 16, 2022 · 3 comments
Labels
help wanted Please help with this issue!

Comments

@gloopsies
Copy link

What version of @astrojs/compiler are you using?

1.0.0-beta.47

What package manager are you using?

pnpm

What operating system are you using?

Fedora Linux

Describe the Bug

Currently compiler doesn't allow nesting <table> and <p> elements inside other <p> elements as per HTML standard. But instead of showing a warning or error it just renders unexpected html:

<p>
    <table />
</p>

gets rendered as:

<p></p>
<table />
<p></p>

Link to Minimal Reproducible Example

N / A

@lostra01
Copy link
Contributor

lostra01 commented Jul 18, 2022

This is the excepted behaviour. P tags get auto closed and they are added as siblings. Any online HTML Editor as well as web servers do the same, and will output the same.

Even the HTML Standard states that P tags do not have to be closed if they are followed by specific tags - including Table - and will get auto closed.

ref: https://html.spec.whatwg.org/multipage/grouping-content.html#the-p-element

@natemoo-re natemoo-re added the help wanted Please help with this issue! label Jul 25, 2022
@Mahmoudgalalz
Copy link

Is there's anyone work on this issue, otherwise could I take it,
a little help, where I can find in the Tokenizes the html tags ?

@MoustaphaDev
Copy link
Member

MoustaphaDev commented Dec 22, 2023

When trying to reproduce this issue, this was the output I got:

<p>
    <table></table>
</p>

I believe this is the expected output. We don't show warnings/errors for invalid markup. If invalid, the compiler tries to correct the markup following the html standard.

Pinging @natemoo-re for a gut check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Please help with this issue!
Projects
None yet
Development

No branches or pull requests

5 participants