You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I searched issues and couldn’t find anything (or linked relevant results below)
Problem
Hello,
I am running my personal blog using unified and I am using this plugin.
The steps are as follow:
Write in Markdown
process with unified (+ rehype-parse and rehype-react)
Run ReactDOM.renderToString
Add onto the site
The problem is I already have an existing unified pipeline that handles markdown with code snippets but this new process integrating with the react components is breaking some things.
I have many code samples on the site using Typescript etc and it thinks those are react components.
For Example:
Array<string>
Solution
I think it would be great to support a new options - options.supportedTags .
What it will include: list of tags (ie ['p', 'a', ...])
Type: Array
It will have the following behaviours:
If there are no tags defined, default to original behaviour (parsing everything)
If tags are defined, only run the processing on the listed tags
Alternatives
I mean technically I can pass in all those tags into the options.components but that is a pain because every time I write a blog post with snippets using Typescript, I would need to update the list.
I am open to other solutions though.
Let me know I can make a PR for this with tests.
I am happy to support it (It would be great to have for me) 🙏
The text was updated successfully, but these errors were encountered:
Initial checklist
Problem
Hello,
I am running my personal blog using unified and I am using this plugin.
The steps are as follow:
rehype-parse
andrehype-react
)ReactDOM.renderToString
The problem is I already have an existing unified pipeline that handles markdown with code snippets but this new process integrating with the react components is breaking some things.
I have many code samples on the site using Typescript etc and it thinks those are react components.
For Example:
Solution
I think it would be great to support a new options -
options.supportedTags
.What it will include: list of tags (ie
['p', 'a', ...]
)Type: Array
It will have the following behaviours:
Alternatives
I mean technically I can pass in all those tags into the
options.components
but that is a pain because every time I write a blog post with snippets using Typescript, I would need to update the list.I am open to other solutions though.
Let me know I can make a PR for this with tests.
I am happy to support it (It would be great to have for me) 🙏
The text was updated successfully, but these errors were encountered: