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

Invalid HTML tree support #8

Open
stevenvachon opened this issue Aug 4, 2016 · 1 comment
Open

Invalid HTML tree support #8

stevenvachon opened this issue Aug 4, 2016 · 1 comment

Comments

@stevenvachon
Copy link

stevenvachon commented Aug 4, 2016

With corrected HTML trees, inline transformations can use correct CSS selectors. Bad HTML templates are common from designers:

<style>
  a { color:yellow }
  table a { color:red }
</style>

<table>
  <a href="#">link</a>
  <tr><td></td></tr>
</table>

would otherwise become:

<table>
  <a href="#" style="color:red">link</a>
  <tr><td></td></tr>
</table>

instead of:

<a href="#" style="color:yellow">link</a>
<table>
  <tr><td></td></tr>
</table>
@stevenvachon
Copy link
Author

stevenvachon commented Dec 16, 2016

This could be solved by recommending the user to use a [currently theoretical] posthtml-parse5 parser plugin, instead of trying to correct a tree parsed with the default htmlparser2.

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

1 participant