网站首页 网站源码
website
站点相关全部源代码,隐藏了一些关于服务器的信息
@using Markdig
@using AngleSharp
@using Dpz.Core.Infrastructure
@model string

@{
    var pipeline = new MarkdownPipelineBuilder().DisableHtml().Build();
    var content = Markdown.ToHtml(Model,pipeline);
    var context = BrowsingContext.New(Configuration.Default);
    var html = await context.OpenAsync(x => x.Content(content));
    var links = html.GetElementsByTagName("a");
    links.ForEach(x =>
    {
        var href = x.GetAttribute("href");
        if (href != null && !href.StartsWith("javascript", StringComparison.CurrentCultureIgnoreCase))
        {
            x.SetAttribute("target", "_blank");
        }
    });
}
@Html.Raw(html.Body?.InnerHtml)
loading