asp.net mvc 将 <asp> 转换为 razor markdowndeep

asp.net mvc translate <asp> to razor markdowndeep

正在做一个 'school' 项目,什么是 Whosebug 'remake'。 'remake'除了一部分完成了

试图弄清楚如何实施 markdown(deep) 以便可以有问题和答案 posted 丰富的内容而不仅仅是文本。

现在,在花了半天时间后,我找到并设法得到了一个示例 运行。

我遇到的唯一问题是它无法在我的项目上运行。

这是我使用的来源 MarkdownDeep

所以我使用完全相同的方式在我自己的视图控制器的给定源中完成:'NewQuestion'

要显示的静态(示例)内容:

static string m_Content =
  @"# Edit this Page with MarkdownDeep
    This demo project shows how to use MarkdownDeep in a typical ASP.NET MVC application.
  * Click the *Edit this Page* link below to make changes to this page with MarkdownDeep's editor
  * Use the links in the top right for more info.
  * Look at the file `MarkdownDeepController.cs` for implementation details.
    MarkdownDeep is written by [Topten Software](http://www.toptensoftware.com).
    The project home for MarkdownDeep is [here]
    http://www.toptensoftware.com/markdowndeep). ";

控制器:

public ActionResult Index()
{
    // View the user editable content
    // Create and setup Markdown translator
    var md = new MarkdownDeep.Markdown();
    md.SafeMode = true;
    md.ExtraMode = true;
    // Transform the content and pass to the view
    ViewData["Content"] = md.Transform(m_Content);
    return View();
}

查看(新问题):

..
<div class="row">
    <div class="col-md-8">
       @ViewData["Content"]
    </div>
</div>
...

结果

如您所见,没有出现 js 或 jQuery 文件未找到之类的错误。在我看来,内容已正确转换。

可能是因为示例是从 <asp> 运行的,而我使用的是剃须刀?

我真的很困惑,不知道怎么解决。已经花了几个小时来了解发生了什么。另外,刚开始 asp.net 所以你真的可以帮助我。

p.s,如果还有更多information/details需要我很乐意更新这个post。

尝试使用 Html.Raw()

@Html.Raw(@ViewData["Content"])