mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-08 13:54:54 +00:00
MarkdownDocument to HTML #70
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 @Weasy666 on GitHub (Nov 30, 2016).
Is there an easy way to convert a MarkdownDocument to HTML? Like
I feel plain stupid but i couldn't find a way to convert a MarkdownDocument to a HTML string.
I can't use the Markdown.ToHtml() with the markdown text as a string, because i have some Relative URLs like
../pics/picture.pngand need to convert them to Absolute URLs.I'm doing this with the
MarkdownDocument.Descendants().OfType<LinkInline>()and modifing the Url property. But after doing that i'm not able to convert the MarkdownDocument to HTML.It would be great if you could help me with this matter.
@xoofx commented on GitHub (Nov 30, 2016):
Use
HtmlRendererdirectly (as it is done by theMarkdown.ToHtmlmethod), something like this:@Weasy666 commented on GitHub (Nov 30, 2016):
Works like a charm. Thank you!