Open devanshj opened 2 years ago
Hi @devanshj,
Thanks for reaching out and reporting the issue. Interestingly, I noticed the issue on the project in which I’m using rehype-shiki at about the same time you reported it.
The reason seems to be that unistUtilModifyChildren
doesn’t traverse the tree like I expected it would. Like you pointed out, the solution is probably to use unist-util-visit
.
Do you think you could draft a pull request? 😁
Thanks for reaching out and reporting the issue.
No problems.
Do you think you could draft a pull request? 😁
I already tried getting it work with unist-util-visit
as I said but it seems there were other complications (which I don't have time to investigate), so I don't think I'll be able to send a PR 😅. Moreover I ended up writing a plugin myself.
👍 Thanks for the information. I’ll get to this soon…
Hey @leafac did you get a chance to start this? I'd like to send a PR but I don't want to duplicate work if you have a WIP implementation.
@calebeby Please go ahead! I haven’t started with this yet. Looking forward to your contribution. Thanks!
Currently this plugin can only highlight
pre
s at the root, so the followingpre
won't transform...The problem is the plugin doesn't traverse the whole tree (with something like
unist-util-visit
), I tried to fix this but for some reason (that I don't remember) it didn't work.(Related: https://github.com/mdx-js/mdx/discussions/1939)