开发者

make wmd-editor not post html?

I have code similar to the below

<form action="/u" method="post">
<div class="reply">
<input type="hidden" name="type" value="2"/>
<input type="hidden" name="id" value="1"/>
<input type="hidden" name="parentId" value="0"/>
<textarea name="text" style="width: 500px; height: 200px;"></textarea><div class="rhs"><button>Post Comment</button></div></div>
</form>

It seems that i dont need a name for the editor to work however i need to use name so i can pos开发者_Go百科t the data. Issue is i do NOT get the text data that the user enters but the generated html from markdown editor. How do i set it so i get the normal raw html that the user types?


Change the output option from HTML to markdown.

It looks something like:

Attacklab.wmd_defaults = { 
  version: 1, output: "markdown", lineLength: 40, delayLoad: false 
};


Although this question has already been answered here is an additional tip that may be of relevance: There is an easy way to post both the html and the markdown, by posting via javascript and using the preview component to get the html, and the textarea to get the markdown source. Here is a blog post by me with more details.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜