【问题标题】:Can't seem to save the markup version of the text using wmd-editor似乎无法使用 wmd-editor 保存文本的标记版本
【发布时间】:2011-01-07 01:29:45
【问题描述】:

当我使用 wmd 编辑器保存 textarea 的上下文时遇到了一个问题,它一直想将其保存为 html。我有以下代码:

输入元素...

<p>
    <%= this.Html.TextArea("Body", topic.Body, new { @class = "big" })%>
</p>

制作输出降价的脚本...

<script type="text/javascript">

    wmd_options = {
        output: "Markdown"
    };

</script>

控制器代码...

    [Authorize]
    [ValidateInput(false)]
    [AcceptVerbs(HttpVerbs.Post)]
    public ActionResult Create(FormCollection collection)
    {
        var topic = WikiService.TopicNew();

        topic.Name = collection["Name"];
        topic.Body = collection["Body"];

        // Just saving the contents
    }

我错过了什么吗?知道为什么它不会返回 textarea 的降价版本吗?

【问题讨论】:

    标签: asp.net-mvc markdown wmd wmd-editor


    【解决方案1】:

    我想通了......我让我的 javascript 将 wmd.js 拉入页面顶部而不是底部......当然,就在说明所说的位置。我的错!

    【讨论】:

      【解决方案2】:

      我自己没有使用过这个编辑器,但我会在控制器端尝试 html en/decrypt。

      至少,这会给你安全的 html 以保存到数据库。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2011-03-05
        • 2019-12-03
        • 2020-12-11
        • 2021-05-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-02-14
        相关资源
        最近更新 更多