Skip to content

node name info lost after parsed #2294

Closed Answered by wooorm
JounQin asked this question in General
May 3, 2023 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Hi! This behavior is expected.

The whitespace is meaningless. Theoretically in JS you could even have comments in there, although that isn’t supported in MDX. All whitespace that is meaningless, is ignored in the AST in other places too.

ASTs are supposed to make inspecting and modifying them easier, this goes agains that.
Even if we did, we’d never show the closing tag name.

If you want such features, you should probably not use the AST tools we provide. But work with the events. It’s going to get complex though: https://github.com/micromark/micromark#architecture

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@JounQin
Comment options

JounQin May 3, 2023
Collaborator Author

@wooorm
Comment options

Answer selected by JounQin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants