How hard to add full-fidelity round-tripping? #304

Closed
opened 2026-01-29 14:33:16 +00:00 by claunia · 2 comments
Owner

Originally created by @jazzdelightsme on GitHub (Jun 20, 2019).

How difficult of a change would it be to add support for full-fidelity round-tripping?

I see you have already added the beginning of support for normalization (#155), but in my view, normalization is distinct from round-tripping. To be clear, I mean I'd like to be able to parse the document, then (assuming I don't make any changes), write it back out (as markdown), and the result should be byte-for-byte identical.

The reason is that I'd like to make certain programmatic transformations of large bodies of documents, but I can't be going in and "normalizing" everything (that would actually be desirable at some point as a separate exercise; but it's just too much change for now).

Originally created by @jazzdelightsme on GitHub (Jun 20, 2019). How difficult of a change would it be to add support for full-fidelity round-tripping? I see you have already added the beginning of support for *normalization* (#155), but in my view, normalization is distinct from round-tripping. To be clear, I mean I'd like to be able to parse the document, then (assuming I don't make any changes), write it back out (as markdown), and the result should be byte-for-byte identical. The reason is that I'd like to make certain programmatic transformations of large bodies of documents, but I can't be going in and "normalizing" everything (that would actually be desirable at some point as a separate exercise; but it's just too much change for now).
Author
Owner

@xoofx commented on GitHub (Jun 20, 2019):

How difficult of a change would it be to add support for full-fidelity round-tripping?

Quite some work, difficult to say in details as I haven't touched the code deeply for the past 2 years. But there are many parts that are today completely discarded (e.g exact number of spaces in all situations - blank lines - spaces after list items...etc.)
But It is certainly doable.

@xoofx commented on GitHub (Jun 20, 2019): > How difficult of a change would it be to add support for full-fidelity round-tripping? Quite some work, difficult to say in details as I haven't touched the code deeply for the past 2 years. But there are many parts that are today completely discarded (e.g exact number of spaces in all situations - blank lines - spaces after list items...etc.) But It is certainly doable.
Author
Owner

@jazzdelightsme commented on GitHub (Jul 3, 2019):

Thank you!

@jazzdelightsme commented on GitHub (Jul 3, 2019): Thank you!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#304