Skip to content

mdast-util-to-hast: access options from wrap() #78

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

You must be logged in to vote

The output is indeed readable. And is similar to how CommonMark generates line endings. It doesn’t match the CommonMark examples entirely in several places.

Unfortunately it makes manipulating/restructuring the hast a little trickier

I see good reason for the HTML generated by this project to be readable, I don’t see a good reason to make it less readable.
If you want less readable output, rehype-minify, specifically, rehype-minify-whitespace can help?

Whitespace is part of the tree in HTML and it affects many things.
That also means that formatting and minifying them can happen on the AST.
And I think I believe it should happen there instead of a serializer.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@TRIAEIOU
Comment options

@wooorm
Comment options

@TRIAEIOU
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