I recently needed, for a side project, a way to display styled text - text blocks with word-wrapping, bold, lists and hyperlinks - in a WPF application.

The display text isn’t static, but is going to be generated by code and/or loaded from files, so I needed a solution that was quite flexible in how it worked.

Markdown seemed like a good choice - easy to write and to generate, if only there was a good way to display the formatted results. I found a number of heavyweight solutions but they all seemed like overkill for my simple needs.

My solution? A port of MarkdownSharp that renders to a XAML FlowDocument instead of a string containing HTML.

The resulting code: Markdown.XAML is now available on Github.

Comments

blog comments powered by Disqus