スタックオーバーフローの「リメイク」のような「学校」プロジェクトに取り組んでいます。「リメイク」は一部を除いて終了。
質問と回答がテキストだけではなくリッチ コンテンツに投稿されるように、マークダウン (ディープ) を実装する方法を見つけようとしています。
文字通り半日を費やした後、私は例を見つけて実行することができました。
私が抱えている唯一の問題は、それが私のプロジェクトで機能していないことです。
これは私が使用するソースです 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 を始めたばかりなので、ここで私を本当に助けてくれます。
ps、さらに情報/詳細が必要な場合は、この投稿を更新させていただきます.