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

Improper DOM Generation Prevents Correct HTML Rendering #1578

Open
Lucacici opened this issue Sep 27, 2024 · 1 comment
Open

Improper DOM Generation Prevents Correct HTML Rendering #1578

Lucacici opened this issue Sep 27, 2024 · 1 comment

Comments

@Lucacici
Copy link

Some websites generate DOM structures in a non-standard manner, leading to HTML files that cannot be rendered correctly and require manual fixes.

Example

Problem
The browser cannot render a p element containing a nested ul. Change p to div to render it correctly.

Environment

  • OS: Win10
  • Browser: Firefox, Edge

Request
check if a p element contains any block elements, and replaces it with a div if necessary.

@gildas-lormeau
Copy link
Owner

gildas-lormeau commented Sep 27, 2024

The problem is that <div> is the tag of a block-level element and is also disallowed in a <p> tag. Only these tags are valid: https://developer.mozilla.org/en-US/docs/Web/HTML/Content_categories#phrasing_content.

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

No branches or pull requests

2 participants