wmd

常见content-type对应表

狂风中的少年 提交于 2020-12-17 21:32:48
常使用的几种   种类 文件扩展名 Content-Type(Mime-Type) 2003 Excel .xls application/vnd.ms-excel 2010 Excel .xlsx application/vnd.openxmlformats-officedocument.spreadsheetml.sheet 文本文件 .txt text/plain 图片 .png/.jpg/.gif image/* 页面 .htm/.html text/html 视频 .avi/ .mpg/ .mpeg/ .mp4 video/* 音频 .mp3/ .wav/ audio/* PDF .pdf application/pdf Office 文件扩展名 Content-Type(Mime-Type) .doc application/msword .dot application/msword .docx application/vnd.openxmlformats-officedocument.wordprocessingml.document .dotx application/vnd.openxmlformats-officedocument.wordprocessingml.template .docm application/vnd.ms-word.document

HTTP ContentType

情到浓时终转凉″ 提交于 2020-04-08 22:12:24
https://tool.oschina.net/commons/ 文件扩展名 Content-Type(Mime-Type) 文件扩展名 Content-Type(Mime-Type) .*( 二进制流,不知道下载文件类型) application/octet-stream .tif image/tiff .001 application/x-001 .301 application/x-301 .323 text/h323 .906 application/x-906 .907 drawing/907 .a11 application/x-a11 .acp audio/x-mei-aac .ai application/postscript .aif audio/aiff .aifc audio/aiff .aiff audio/aiff .anv application/x-anv .asa text/asa .asf video/x-ms-asf .asp text/asp .asx video/x-ms-asf .au audio/basic .avi video/avi .awf application/vnd.adobe.workflow .biz text/xml .bmp application/x-bmp .bot application/x-bot .c4t

Whitelisting, preventing XSS with WMD control in C#

北慕城南 提交于 2020-01-15 11:56:07
问题 Are there any problems with what I am doing here? This is my first time to deal with something like this, and I just want to make sure I understand all the risks, etc. to different methods. I am using WMD to get user input, and I am displaying it with a literal control. Since it is uneditable once entered I will be storing the HTML and not the Markdown, input = Server.HTMLEncode(stringThatComesFromWMDTextArea) And then run something like the following for tags I want users to be able to use.

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

WMD in Django Admin?

怎甘沉沦 提交于 2019-12-30 02:10:09
问题 I know how to use WMD and other such javascript editors in regular django forms using widget=. However, how do I use WMD for text fields in the Django admin? On top of that, how do I use it for the content field on contrib.flatpages in the admin? Also, I think I might like to use the StackOverflow fork of WMD, so I would like any special instructions for that, if necessary. I know how to use the markdown filter in the templates, so that part is ok. I just need to get the editor to show up and

How do you store the markdown using WMD in ASP.NET?

折月煮酒 提交于 2019-12-29 04:24:16
问题 I have implemented the WMD control that Stack Overflow uses into a project of mine, it almost works like a charm, but when I save the changes to the database it is saving the HTML version and not the Markdown version. So where I have this in my text box: **boldtext** It is really saving this: <b>boldtext</b> How do I make it save the Markdown version? 回答1: Before you include wmd.js , or whatever you've named the WMD editor JavaScript code locally, add one line of JavaScript code: wmd_options

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

How to combine WMD and prettify, like Stack Overflow?

我怕爱的太早我们不能终老 提交于 2019-12-21 04:22:21
问题 Prettify needs class="prettyprint" to be add to <pre> or <code> . How to let WMD do this? 回答1: Take a look at the PageDown Markdown editor... AFAIK, WMD is dead, but PageDown is a fork based on the WMD source. It's an active project based on the work done in WMD. That takes care of the Markdown editor. To get syntax highlighting working you'll also need to download source from the Google-Code-Prettify project. Combine the demo.html, demo.css, prettify.js, prettify.css into the same folder.

running showdown.js serverside to conver Markdown to HTML (in PHP)

与世无争的帅哥 提交于 2019-12-19 11:12:21
问题 I am trying to implement WMD onto my website and was wondering how would I go about running showdown.js server side to convert markdown to HTML? (in order to store both in the DB) I am using PHP...any tips would be helpful (never ran any sort of js from php before) Thanks, Andrew 回答1: You could use PHP Markdown, which is a port of the Markdown program written by John Gruber. Here is a example of how to use PHP Markdown with your code. include_once "markdown.php"; $my_html = Markdown($my_text)

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?