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

MarkdownTextBlock: add alternative to Text property to pass in a MarkdownDocument to the control #596

Open
jcoc611-microsoft opened this issue Nov 14, 2024 · 0 comments

Comments

@jcoc611-microsoft
Copy link

Currently, the only way to set the content of a MarkdownTextBlock is via the Text property, which internally uses Markdown.Parse to convert to a MarkdownDocument. It would be nice to also allow users to pass in an existing MarkdownDocument as an alternative.
 
Example:

<controls:MarkdownTextBlock
  MarkdownDocument="{x:Bind Doc, Mode=OneTime}" />

Benefits:

  • Users can insert arbitrary logic after Markdown.Parse(...), such as mutating the MarkdownDocument tree with decorations
  • Users can provide a custom Markdown pipeline
  • Users can preserve the MarkdownDocument for other operations, such as copying the content to HTML with Markdown.ToHtml(...)
jcoc611-microsoft pushed a commit to jcoc611-microsoft/Labs-Windows that referenced this issue Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant