让wmd-editor不发布html?
我有类似于下面的代码
<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>
似乎我不需要编辑器的名称来工作,但是我需要使用名称以便我可以发布数据。问题是我没有获得用户输入的文本数据,而是从 Markdown 编辑器生成的 html。我如何设置它才能获得用户输入的正常原始 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 post 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将输出选项从 HTML 更改为 Markdown。
它看起来像:
Change the output option from HTML to markdown.
It looks something like:
虽然这个问题已经在这里得到解答,但还有一个可能相关的提示:有一种简单的方法可以发布 html 和 markdown,通过 javascript 发布并使用预览组件获取 html,并将文本区域发布到获取 Markdown 源。这是我的博客文章,其中包含更多详细信息。
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.