Releases: RickStrahl/Westwind.AspNetCore.Markdown
3.2.2
3.2
-
Add support for replacing Markdown Engine
Added support for anIMarkdownParserFactory
to create a customIMarkdownParserFactory
andIMarkdownParser
implementation.
The factory can be applied in the configuration viaconfig.MarkdownParserFactory
inStartup.ConfigureServices()
of the application. -
Add support for loading Markdown from a URL
The Markdown static class and TagHelper now have support for loading Markdown from a URL.Markdown.ParseFromUrl()
along with async and HtmlStringVersions as well as aurl=
attribute on the TagHelper allow for loading Markdown from a URL. -
Fix: Trailing Slash Handling for Markdown Extensionless Urls
Fixed issue where a trailing slash would not render Markdown document if a matching .md file is found.
Note: while pages with backslashes now render, the resulting page may not render properly due to an invalid base path. This is not related to the component but to HTML pathing - the same is true for MVC views for example with releative paths. I highly recommend you don't use a trailinig slash for Markdown Urls to preserve the proper basepath in your document or you ensure~/
paths in your document. -
Markdown TagHelper Filename Property
You can now include Markdown content from the site's file system using the<markdown>
TagHelper file thefilename
attribute. This makes it easy to break out large text blocks and edit and maintain them easily in your favorite Markdown editor vs. editing inline the HTML content. Note that related resources are host page relative, not relative to the Markdown page so plan accordingly for links and image refs. -
Markdown.ParseFromFile(), ParseFromFileAsync() and .ParseHtmlStringFromFile()
Like the TagHelper functions above these static methods allow you to load Markdown from a file within the Web site using virtual path syntax (~/MarkdownFiles/MarkdownPartial.md
). Note that related resources are host page relative rather than markdown page relative.