Skip to content

Post-processing textual content with typeset js #1487

Answered by ChristianMurphy
davenquinn asked this question in Q&A
Discussion options

You must be logged in to vote

Should I be thinking of hooking in somewhere at a single-component level, or is there a place I can modify all textual dom nodes while keeping nested components intact if possible?

It really depends on what you want to do.
The closest to textual dom nodes MDX gets is the hast+mdx phase https://mdxjs.com/advanced/ast
which can be accessed with rehype plugins https://mdxjs.com/advanced/plugins
Unified/MDX provides a guide on creating plugins here: https://unifiedjs.com/learn/

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
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
Q&A
Labels
None yet
2 participants