Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否有任何快速方法可以在 ServiceStack Razor 页面中将值呈现为 Markdown?
例如 @MyText.ToMarkdown() 什么的?
是的,您可以使用:
@Html.RenderMarkdownToHtml("## Heading2")
或者您可以手动将 markdown 转换为 HTML 并嵌入原始 HTML:
@(new MarkdownSharp.Markdown().Transform("## Heading2").AsRaw())