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

Replace high-level <p> tags with <div> #513

Open
fedarko opened this issue May 1, 2021 · 0 comments
Open

Replace high-level <p> tags with <div> #513

fedarko opened this issue May 1, 2021 · 0 comments
Labels

Comments

@fedarko
Copy link
Collaborator

fedarko commented May 1, 2021

One weird thing I noticed in the side panel HTML is that there are hidden <p> tags that take up some space at the bottom of the sample / feature metadata coloring panels:

huh

While trying to figure out the cause of this I ran the side panel HTML through prettier (currently prettier just works on the JS/CSS, but it supports HTML). prettier gave the following error:

[error] empress/support_files/templates/side-panel.html: SyntaxError: Unexpected closing tag "p". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags (62:3)
[error]   60 |       </p>
[error]   61 |     </div>
[error] > 62 |   </p>
[error]      |   ^
[error]   63 | </div>
[error]   64 | 
[error]   65 | <!-- Feature Metadata Coloring Options -->

It looks like the reason for this (prettier/prettier#5833) is that putting other <p> tags, or <div> tags, inside of <p> is not allowed per the HTML spec. I suspect this is causing small formatting problems in some browsers, likely including the one I mentioned earlier. (Even if not, we should try to have valid HTML.)

I think the way to address this is change the top-level <p> tags to <div>, make sure they're styled as they were before (or close enough), and then re-run the HTML through prettier. I think this should fix things?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant