Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serialize MarkdownDocument to XML? #598

Closed
wadimw opened this issue Feb 23, 2022 · 1 comment
Closed

Serialize MarkdownDocument to XML? #598

wadimw opened this issue Feb 23, 2022 · 1 comment
Labels

Comments

@wadimw
Copy link

wadimw commented Feb 23, 2022

Hi,

I'm looking for a way to safely translate existing Markdown documents without risking syntax issues introduced by human error. It seems that your roundtrip support would be perfect for this - in essence, I've been thinking of parsing the document in question with markdig and localizing only selected strings within the AST. That would alleviate the risk of someone accidentally deleting emphasis, inserting an empty line or deleting some significant HTML comment etc.

Translation itself would need to be performed in some other designated system, so I would need to output the generated document tree to some other format and deserialize it afterwards. Do You think it would be possible to serialize an AST of MarkdownDocument into an XML file?

@MihaZupan
Copy link
Collaborator

I doubt the syntax tree will serialize/deserialize well.

A simpler approach may be extracting the strings you are interested in from the AST and only serializing the string => string translation mappings.

@xoofx xoofx added the question label Mar 1, 2022
@xoofx xoofx closed this as completed Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants