Open jcoc611-microsoft opened 2 weeks ago
Thinking about it more, I think it is actually better to expose the control's MarkdownDocument rather than allowing users to pass one in.
Users can insert arbitrary logic after Markdown.Parse(...)
This should only be done via Markdig extensions. We will provide different extensibility mechanisms which also allow for implementing custom renderers for the outputs of the extensions.
Users can provide a custom Markdown pipeline
This is not really desired in general, other than extensions.
Users can preserve the MarkdownDocument for other operations
The control owns the MarkdownDocument and users can just access it directly
TBD: add an event for when parsing is done (before this, accessing MarkdownDocument is not valid, and it would be null)
Currently, the only way to set the content of a MarkdownTextBlock is via the
Text
property, which internally usesMarkdown.Parse
to convert to aMarkdownDocument
. It would be nice to also allow users to pass in an existingMarkdownDocument
as an alternative. Example:Benefits:
Markdown.Parse(...)
, such as mutating the MarkdownDocument tree with decorationsMarkdown.ToHtml(...)