Skip to content

Keep node.data in hast-util-raw because it's a standard unist node property #148

Answered by wooorm
JounQin asked this question in General
Discussion options

You must be logged in to vote

There is a difference between markdown and HTML, remark and rehype.
rehype-shiki is for HTML. It should support HTML. It should not only support markdown. It is nice if it supports markdown. But it should also support someone writing actual HTML and passing things as HTML attributes.

Such as https://github.com/rehypejs/rehype-twoslash/blob/19c933630ebb3abcce32e0dea123bb6bb2511e2b/lib/index.js#L110-L114

but we want to enable rehype-raw in the built-in step

Why? It is a complex operation that slows people down who do not need it.
You should probably not default to it.

But if you must have it, and rehype-shiki supports HTML too, then you can use a plugin before rehype-raw to turn data into…

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@wooorm
Comment options

@JounQin
Comment options

JounQin May 29, 2025
Collaborator Author

@SoonIter
Comment options

@wooorm
Comment options

Answer selected by JounQin
@JounQin
Comment options

JounQin May 29, 2025
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants