Skip to content

Preserve formatting #354

Answered by kivikakk
mightyiam asked this question in Q&A
Discussion options

You must be logged in to vote

Not with Comrak — it doesn't preserve the original formatting details in its AST (per upstream cmark). So, e.g. _a_ will instead roundtrip to *a*; the output Markdown when using CommonMark output will preserve the meaning of the input, but not any precise formatting.

It is guaranteed to roundtrip stably, however; i.e. given some input A, when converted back to Markdown you'll get A' (which may or may not be equal to A); when converting A' you will again get A'.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mightyiam
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