Skip to content

html inline CSS properties into the style attribute #98

Answered by ChristianMurphy
SilvaQ asked this question in Ideas
Discussion options

You must be logged in to vote

Could juice be used with Rehype? Yes
It 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.

offer an ast extension

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#399

That 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.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ChristianMurphy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants