mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-03 21:36:36 +00:00
[Question]: Does this library programmatically expose the AST? #601
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @fourpastmidnight on GitHub (Apr 27, 2023).
First, I checked out this library and it is simply fantastic, supporting all major Markdown concepts. Hats off to you and all contributors for making such a great library for rendering Markdown via C#!
I was looking through the source code, but I didn't seem to see anything where I could use the generated AST when parsing a markdown document. Does this library expose the AST in any way, similar to how Roslyn programmatically exposes the C# AST, so that one could manipulate the AST to influence the final outcome?
My use case is that I would want to dynamically build up one or more markdown fragments. For example, a tool that would prompt users for text in order to say, generate a changelog entry. The same tool could parse an existing markdown document and perhaps, using the AST, transform the AST to update the resulting document. Working with an AST instead of raw text would be much more efficient and less error-prone.
@fourpastmidnight commented on GitHub (Apr 27, 2023):
Ah, I found the documentation. I simply missed it. Great!!
@karmeye commented on GitHub (Aug 17, 2024):
@fourpastmidnight Could you provide the link? I'm trying to parse a Markdown document, modify the contents, then save it back to Markdown.