posthtml-inline-css icon indicating copy to clipboard operation
posthtml-inline-css copied to clipboard

Invalid HTML tree support

Open stevenvachon opened this issue 9 years ago • 1 comments

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 avatar Aug 04 '16 16:08 stevenvachon

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.

stevenvachon avatar Dec 16 '16 15:12 stevenvachon