@{
    Layout = null;
    var documentinfo = (FreeSql.Site.Entity.DocumentContent)ViewBag.DocumentInfo;
}
@if (ViewBag.DocumentInfo == null)
{
    <span>文章不存在，请选择其它文章查看！</span>
}
else
{
    <h1 class="site-h1">@documentinfo.DocTitle</h1>
    <div id="details_content" style="display:none;">
        <blockquote>
            @documentinfo.DocAbstract
        </blockquote>
        @documentinfo.DocContent
    </div>
    <script>
        if ('@documentinfo.OriginType' == '1') {
            var options = {
                elm: "details_content", url: "@documentinfo.OriginUrl", paramters: "", loadIndex: 1,
                successCallBack: function () {
                    debugger
                    document.getElementById('details_content').innerHTML =
                        marked($("#details_content").html());
                }
            };
            freejs.loadHtml(options);
        }
        else {
            if ('@documentinfo.EditorMode' == '0') {
                marked.setOptions({
                    renderer: new marked.Renderer(),
                    gfm: true,
                    tables: true,
                    breaks: true,
                    pedantic: false,
                    sanitize: false,
                    smartLists: true,
                    smartypants: false,
                });
                marked.setOptions({
                    highlight: function (code) {
                        return hljs.highlightAuto(code).value;
                    }
                });
                document.getElementById('details_content').innerHTML =
                    marked($("#details_content").html());
            }
            else {
                //直接里面的内容就是HTML
            }
        }
        $("#details_content").show();
    </script>
}