html inline CSS properties into the style attribute #98
-
Is it possible that we could combine the power of juice's library with our Rehype line and offer an ast extension? Markdown to HTML special scenes need this ability, if we can customize it better! Juice project address:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Could
It could be made a plugin with the stringify and re-parse approach noted above. That said, if you wanted to create an AST based alternative, you could. |
Beta Was this translation helpful? Give feedback.
Could
juice
be used with Rehype? YesIt works on raw HTML, so Rehype would need to stringify then re-parse to be integrated in the pipeline, or
juice
could be applied after Rehype is done.It could be made a plugin with the stringify and re-parse approach noted above.
juice
doesn't support ASTs and is unlikely to change anytime soon, given that it is not currently maintained Automattic/juice#399That said, if you wanted to create an AST based alternative, you could.
In theory https://www.npmjs.com/package/hast-util-select could be used as an alternative to jQuery/Cheerio selectors to re-implement the functionality.