wmd-editor

Align the WMD editor's preview HTML with server-side HTML validation (e.g. no embedded JavaScript code)

泄露秘密 提交于 2020-01-01 03:27:10
问题 There are many Stack Overflow questions (e.g. Whitelisting, preventing XSS with WMD control in C# and WMD Markdown and server-side ) about how to do server-side scrubbing of Markdown produced by the WMD editor to ensure the HTML generated doesn't contain malicious script, like this: <img onload="alert('haha');" src="http://www.google.com/intl/en_ALL/images/srpr/logo1w.png" /> But I didn't find a good way to plug the hole on the client side too. Client validation isn't a replacement for

Can't seem to save the markup version of the text using wmd-editor

拜拜、爱过 提交于 2019-12-23 05:17:29
问题 I'm running into an issue when I am saving the context of textarea using the wmd-editor it keeps wanting to save it as html. I have the following code: The input elements... <p> <%= this.Html.TextArea("Body", topic.Body, new { @class = "big" })%> </p> The script to make the out put markdown... <script type="text/javascript"> wmd_options = { output: "Markdown" }; </script> The controller code... [Authorize] [ValidateInput(false)] [AcceptVerbs(HttpVerbs.Post)] public ActionResult Create

Using wmd-new to submit markdown

半世苍凉 提交于 2019-12-13 20:29:40
问题 Does anyone use the wmd-new editor posted on google code? I've installed the editor and got it to work correctly. I thought the editor would submit raw markdown. To my surprise it submits HTML. This is a problem because I need to store a markdown version of the text. Another issue is, if there's a validation error, the form will reload with HTML instead of the original markdown. This would puzzle users unfamiliar with HTML. Any ideas how to get it to submit raw markdown, or HTML and markdown?

WMD editor, rails, compass : How to get the generated Markdown code read as HTML and displayed as 'rich-text'?

[亡魂溺海] 提交于 2019-12-11 23:22:25
问题 I quite like that WMD is behaving nicely with my app. However, I have one problem. Basically I edit content and store it as markdown in my database. Then I use Kramdown to get the HTML for the views. However Kramdown gets me the HTML tags which are not read by my browser. I use Chrome. Sanitizing it will give a plain text even when the user has entered e.g. bold, italic, code etc. So the basic idea is to get the generated HTML read as HTML and as 'rich-text'. Inspecting the output source, I

multiple wmd textareas on the same page

僤鯓⒐⒋嵵緔 提交于 2019-12-11 05:59:40
问题 I'm trying to use the wmd markdown text editor for my site. I have two textareas on my page and I need the wmd editor for both. By default, it assigned it only to the first texarea, but how do I apply it to both textareas? Also, I always get an extra new line at the end of my markedup text that was saved by wmd. How can I prevent that? Thanks! 回答1: check my version. It has multiple instances on the same page. 来源: https://stackoverflow.com/questions/1218443/multiple-wmd-textareas-on-the-same

wmd-editor breaks in IE8

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 18:25:37
问题 We have recently started using WMD editor and found that in IE 8, it just goes on increasing the scroll size of the page by simply increasing the size of the textarea endlessly. The only option left is to close the browser after that causing lot of frustration. you can check wmd-editor demo here. does anybody know of any solution to this issue ? 回答1: after a lot of trial & error, we finally found the issue and fixed it ourselves. None of the parent container of the div in which the wmd editor

Saving contents of the WMD Editor Control

℡╲_俬逩灬. 提交于 2019-12-04 10:45:42
问题 I'm trying to implement the WMD editor used on StackOverflow to create some basic Wiki-style functionality. I'm up to the point where it's time to save to the database, but I'm unsure as to what I should be saving. If I save the produced HTML then I can retrieve and display it correctly, but on re-edit I'm faced with editing HTML, not Markdown. However, if I save the Markdown I can't see any way of converting this back to HTML to display, and looking at StackOverflow it sends the browser HTML