Skip to content

hast-util-to-mdast - adding custom mdast nodes #75

Answered by wooorm
TRIAEIOU asked this question in Q&A
Discussion options

You must be logged in to vote

Specific to that project, it relates to “wrapping”: https://github.com/syntax-tree/hast-util-to-mdast/blob/main/lib/util/wrap.js. Right?

That list currently, as you mention, uses mdast-util-phrasing: phrasing nodes in mdast. That list currently can’t be extended.

One solution is to add an options.phrasing. But, that’s probably so niche that it is not useful to many folks and if it would be useful to them, they probably wouldn’t find it.

There is a similar list, hast-util-phrasing, which works on HTML tag names. The wrapping doesn’t operate on that, but it might be interesting.

What, if you attach HTML information to your custom nodes? That information is useful for the reverse process: ht…

Replies: 1 comment 8 replies

Comment options

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

@TRIAEIOU
Comment options

@wooorm
Comment options

@TRIAEIOU
Comment options

@wooorm
Comment options

Answer selected by TRIAEIOU
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