Search Results

Search found 38 results on 2 pages for 'wmd'.

Page 1/2 | 1 2  | Next Page >

  • wmd editor (jquery version) over ajax forms

    - by Davide Barison
    i'm trying wmd editor over ajax. here there is the bugged code wdm code is based on openlibrary fork on github it work very good without ajax. but when i try to display editor over ajax form it doesn't load. non ajax version produce this html: <div id="wmd-container"> <div id="wmd-button-bar"></div> <div id="wmd-button-bar-0" class="wmd-button-bar"><ul class="wmd-button-row"><li style="background-position: 0px 0px;" title="Strong &lt;strong&gt; Ctrl+B" class="wmd-button wmd-bold-button"></li><li style="background-position: -20px 0px;" title="Emphasis &lt;em&gt; Ctrl+I" class="wmd-button wmd-italic-button"></li><li class="wmd-spacer"></li><li style="background-position: -40px 0px;" title="Hyperlink &lt;a&gt; Ctrl+L" class="wmd-button wmd-link-button"></li><li style="background-position: -60px 0px;" title="Blockquote &lt;blockquote&gt; Ctrl+Q" class="wmd-button wmd-quote-button"></li><li style="background-position: -80px 0px;" title="Code Sample &lt;pre&gt;&lt;code&gt; Ctrl+K" class="wmd-button wmd-code-button"></li><li style="background-position: -100px 0px;" title="Image &lt;img&gt; Ctrl+G" class="wmd-button wmd-image-button"></li><li class="wmd-spacer"></li><li style="background-position: -120px 0px;" title="Numbered List &lt;ol&gt; Ctrl+O" class="wmd-button wmd-olist-button"></li><li style="background-position: -140px 0px;" title="Bulleted List &lt;ul&gt; Ctrl+U" class="wmd-button wmd-ulist-button"></li><li style="background-position: -160px 0px;" title="Heading &lt;h1&gt;/&lt;h2&gt; Ctrl+H" class="wmd-button wmd-heading-button"></li><li style="background-position: -180px 0px;" title="Horizontal Rule &lt;hr&gt; Ctrl+R" class="wmd-button wmd-hr-button"></li><li class="wmd-spacer"></li><li style="background-position: -200px -20px;" title="Undo - Ctrl+Z" class="wmd-button wmd-undo-button"></li><li style="background-position: -220px -20px;" title="Redo - Ctrl+Shift+Z" class="wmd-button wmd-redo-button"></li><li style="background-position: -240px 0px;" class="wmd-button wmd-help-button"><a title="WMD website" target="_blank" href="http://wmd-editor.com/"></a></li></ul></div><div id="wmd-button-bar-2" class="wmd-button-bar"></div><div id="wmd-button-bar-4" class="wmd-button-bar"></div><textarea id="wmd-input" class="resizable" name="post-text" cols="92" rows="15" tabindex="101"></textarea><div id="wmd-preview-4" class="wmd-preview"></div><div id="wmd-preview-2" class="wmd-preview"></div><div id="wmd-preview-0" class="wmd-preview"></div> </div> with ajax form: <div id="wmd-container"> <div id="wmd-button-bar"></div> <div id="wmd-button-bar-1" class="wmd-button-bar"></div><div id="wmd-button-bar-3" class="wmd-button-bar"></div><textarea id="wmd-input" class="resizable" name="post-text" cols="92" rows="15" tabindex="101"></textarea><div id="wmd-preview-3" class="wmd-preview"></div><div id="wmd-preview-1" class="wmd-preview"></div> </div> any help?

    Read the article

  • WMD editor freezes IE7 for 3 seconds on load

    - by dhruvbird
    Hello all, I am using the WMD editor's original code(not the stackoverflow version) since I need multiple of 'em on the same page and stackoverflow's version makes heavy use of element IDs internally since they aren't going to be having more than one editor instance per page. The code runs fin in FF 3.5, etc.. However, when I run it in IE8 (in IE7 compatibility mode), it freezes the whole browser for about 3 sec. before a new instance shows up. I tried profiling it with IE's dev. tools, and it seems that the getWidth() function on line 520 of the minified version of the code is taking up all the time. However, when I tried to hard-code the return (since it was always returning the same thing), the bottleneck shifted to the getHeight() function. I am attaching the code I am using to convert it to a jQuery plugin. jQuery.fn.wmd = function(params) { function createInstance(container, params) { /* Make sure WMD has finished loading */ if (!Attacklab || !Attacklab.wmd) { alert("WMD hasn't finished loading!"); return; } var defaultParams = { width : "600px", rows : 6, autogrow : false, preview : false, previewDivClassName: "wmd-preview-div" }; if (typeof(params) == "undefined") { var params = defaultParams; } else { var params = jQuery.extend({}, defaultParams, params); } /* Build the DOM elements */ var textarea = document.createElement("textarea"); textarea.style.width = params.width; textarea.rows = params.rows; jQuery(container).append(textarea); var previewDiv = document.createElement("div"); if (params.preview) { jQuery(previewDiv).addClass(params.previewDivClassName); jQuery(container).append(previewDiv); } /* Build the preview manager */ var panes = {input:textarea, preview:previewDiv, output:null}; var previewManager = new Attacklab.wmd.previewManager(panes); /* Build the editor and tell it to refresh the preview after commands */ var editor = new Attacklab.wmd.editor(textarea,previewManager.refresh); /* Save everything so we can destroy it all later */ var wmdInstance = {ta:textarea, div:previewDiv, ed:editor, pm:previewManager}; var wmdInstanceId = $(container).attr('postID'); wmdInstanceProcs.add(wmdInstanceId, wmdInstance); if (params.autogrow) { // $(textarea).autogrow(); } }; if (jQuery(this).html().length > 0) { var wmdInstanceId = jQuery(this).attr('postID'); var inst = wmdInstanceProcs.get(wmdInstanceId); jQuery(inst.ta).show(); } else { createInstance(this, params); } } jQuery.fn.unwmd = function(params) { var wmdInstanceId = $(this).attr('postID'); var inst = wmdInstanceProcs.get(wmdInstanceId); if (inst != null) { jQuery(inst.ta).hide(); } } wmdInstanceProcs = function() { var wmdInstances = { }; var getProc = function(wmdInstanceId) { var inst = wmdInstances[wmdInstanceId]; if (typeof(inst) != "undefined") { return inst; } else { return null; } }; var addProc = function(wmdInstanceId, wmdInstance) { wmdInstances[wmdInstanceId] = wmdInstance; }; return { add: addProc, get: getProc }; }(); Any help would be much appreciated.

    Read the article

  • Convert wmd editor content in html format

    - by kiran826
    Hi, I am very new to using this wmd editor. In simple way, i am using this editor in my page using asp textbox with "wmd-input" class. It is perfectly behaving like a wmd editor. But when enter some data and do some formatting like bold, italic etc and read editor's content from server side, i can see that the data in plain text. Is there any way i can read the data in html formatted data? Thanks for your help.

    Read the article

  • Not able to see Images with wmd-editor

    - by KhanS
    I am using wmd editor to enter some text. After entering the text, I am saving it as mark down into the database. While inserting the image, if I save as markdown I am not able to see the image in my aspx page.(Because it down not save image in <img> tab in markdown). If I save the text as html then, I am able to see the image. But another problem with html is, while editing the text I am seeing all tags(such as <code1><p>pre> ) in the wmd-editor.

    Read the article

  • prevent javascript in the WMD editor's preview box

    - by Justin Grant
    There are many SO questions (e.g. here and here) 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" /> Unfortunately, this still allows script to show up in the WMD client's preview box. I doubt this is a big deal since if you're scrubbing the HTML on the server, an attacker can't save the bad HTML so no one else will be able to see it later and have their cookies stolen or sessions hijacked by the bad script. But it's still kinda odd to allow an attacker to run any script in the context of your site, and it's probably a bad idea to allow the client preview window to allow different HTML than your server will allow. StackOverflow has clearly plugged this hole. How did they do it? [NOTE: I already figured this out but it required some tricky javascript debugging, so I'm answering my own question here to help others who may want to do ths same thing]

    Read the article

  • mediawiki markup equivalent of WMD editor?

    - by Justin Grant
    Anyone have a recommendation for an editor like the WMD editor, but using MediaWiki markup instead of Markdown? Our site is already using MediaWiki markup but we want a slicker editor without changing markup completely. Requirements include: live preview of formatted text underneath the markup you're typing a toolbar for common formatting (bold, italic, links, bullets, numbered-list, code, etc) keyboard shortcuts for each toolbar button (e.g. CTRL+B for bold) Undo/redo via keyboard shortcuts (CTRL+Z/CTRL+Y) or toolbar buttons works well in the usual set of popular browsers (including IE6!) open-source would be preferred

    Read the article

  • How can i get Simple Plain Text from WMD Editor?

    - by stackuser1
    I'm able to get Markdown and html formated text from WMD editor. In my requirement i also need to get plain text from WMD Editor. I would like to explain a simple example. In StackOverflow we will see markdown text while typing description in wmd editor, in preview we are able to see the formated text. In Question Page, with out this markdown and formated text we are able to see the question description in two lines. I need to achieve same kind of functionality. Please suggest me what i need to do.

    Read the article

  • align WMD editor's preview HTML with server-side HTML validation (e.g. no embedded javascript)

    - by Justin Grant
    There are many SO questions (e.g. here and here) 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" /> This doesn't affect the WMD client's preview box. I doubt this is a big deal since if you're scrubbing the HTML on the server, an attacker can't save the bad HTML so no one else will be able to see it later and have their cookies stolen or sessions hijacked by the bad script. But it's still kinda odd to allow an attacker to run any script in the context of your site, and it's probably a bad idea to allow the client preview window to allow different HTML than your server will allow. StackOverflow has clearly plugged this hole. How did they do it? [NOTE: I already figured this out but it required some tricky javascript debugging, so I'm answering my own question here to help others who may want to do ths same thing]

    Read the article

  • wmd editor, why does it keep showing html instead of just going straight to markup

    - by Ke
    hi, im wondering how wmd is supposed to work, when i type in the textarea the text doesnt have html, but once the text is stored in db it turns to html. wmd also shows all this html when reloading the content? is it supposed to work like this? Do I have to sanitize the text before its put into the db? if so how? I thought wmd doesnt deal with html? except in code blocks. Also there are p tags being added Using the beneath html it gets added directly. I guess this could cause xss attacks? - (1) <a onmouseover="alert(1)" href="#">read this!</a> - (2) <p <script>alert(1)</script>hello - (3) </td <script>alert(1)</script>hello I wonder how is wmd supposed to work? I thought it was supposed to enter everything in its own mark up, store its on mark up and retrieve it etc. instead of storing plain html Chees Ke

    Read the article

  • mediawiki markup equivalent of WMD live-previewing editor? (not WYSIWYG)

    - by Justin Grant
    Anyone have a recommendation for an editor like the WMD editor, but using MediaWiki markup instead of Markdown? Our site is already using MediaWiki markup but we want a slicker editor without changing markup completely. Requirements include: live preview of formatted text underneath the markup you're typing a toolbar for common formatting (bold, italic, links, bullets, numbered-list, code, etc) keyboard shortcuts for each toolbar button (e.g. CTRL+B for bold) Undo/redo via keyboard shortcuts (CTRL+Z/CTRL+Y) or toolbar buttons works well in the usual set of popular browsers (including IE6!) open-source would be preferred I've found a few options at http://www.mediawiki.org/wiki/WYSIWYG_editor, but all of these seem to be WYSIWYG editors which is not exactly what I want since full-on WYSIWYG editors tend to be bug-prone and complicate working at the markup level. Instead we want a plain-text markup editor with a client-side previewer, plus some UI niceties (toolbar, undo, keyboard shortcuts) to make editing markup easier.

    Read the article

  • WMD Markdown and server-side

    Hello, I work since 2 days on WMD & Markdown and i don't find THE solution for stock data with security. I would like users can post html/xml (with WMD) on my site. For the moment, I stock data in Markdown format but If I disabled JavaScript the user can push easy XSS. If I strip_tags or html_entities all data i loose the user html/xml . How can I do ? In my opinion I must html_entities just the code between pre /pre, but how?! my data is in Markdown. After, how I can do for forbid xss attributes : <img src="javascript:alert('xss');" /> Sorry for my rusty english. MaxoU

    Read the article

  • markdown to HTML with customised WMD editor

    - by spirytus
    For my application I customized slightly the way WMD behaves so when user enters empty lines, these are reflected in HTML output as <br />'s. Now I came to a point when I should store it somewhere at backend and so after going thru SO posts for a while I'm not sure what is the best way to do it. I have few options and if you could point out which their pros/cons that would be much appreciated. send to server and store as markdown rather than HTML. To me obvious advantage would be keeping exactly same formatting as user originally entered. But then how can I convert it back to HTML for display to a client? It seems very troublesome to convert it on client side as even if it would be possible what would happen if JS would be disabled? If I wanted to do it on the server, then standard server side implementations of markup to HTML might be resource expensive. Would that be an issue in your opinion? Even if it wouldn't be the case then as I mentioned my WMD implementation is customised and those server side solutions wouldn't probably do the right conversion to markdown anyway and there always would be a risk that something would convert wrong. Send to server as converted HTML. Same as above.. conversion on client side would be difficult, server side same with possibility of getting it wrong. send original markdown and converted HTML and store both. No performance issues related to converting markdown to HTML on client side, nor on server side. Users would have always same markdown they originally entered and same HTML they originally saw in preview (possibly sanitized in php though). It would have to take twice that much storage space though and that is my biggest worry. I tend to lean towards 3rd solution as it seems simplest, but there is a worry of doubled storage space needed for this solution. Please bear in mind that my implementation of WMD is slightly modified and also I'm going with PHP/MySql server side implementation. So apart from 3 options I listed above, are there any other possible solutions to my problem? Did I miss anything important that would make one of the options above better then the rest? And what other pros/cons would apply to each solution I listed? Also how is it implemented on SO? I read somwhere that they using option 3, and so if its good enough for SO would be good enough for me :) but not sure if its true anyway, so how is it done? Also please forgive me, but at least for once I got to say that StackOverflow IS THE BEST DAMN RESOURCE ON THE WEB and I truly appreciate all the people trying to help others here! The site and users here are simply amazing!

    Read the article

  • Which MarkDown (WMD) javascript editor should I use?

    - by Edan Maor
    Background I'm working on an application which requires user-entered content, and I've decided to use a StackOverflow-style MarkDown editor. After researching this topic for the last few days, I realize there are numerous forks of the base WMD editor, some with a few basic enhancements and some with serious differences from the StackOverflow one. Since this will be the heart of the application, I'd like to start with the best code base I can. I'd be happy if anyone can recommend which one of the many solutions out there best fits my needs. Below is requirements, plus what I've managed to find already. I'm hoping this question will help me decide which version to go with, and maybe help me discover a port out there that's an even better fit for my needs. The requirements for my project Live Preview Multiple editors on the same page (not know how many in advance, since the user can dynamically add another editing box). Ability to extend with extra buttons (I'd like a button to upload a picture, instead of just adding an img url). Ability to dynamically show/hide the edit box (and only see the preview box). Not an absolute must, but I'd prefer to stick as close to StackOverflow's look and feel, since it's well known. Don't know if this matters, but the backend is written in Django. Editors I've looked at Here are a few of the code bases I've looked at, with thoughts. Obviously, I might be missing another solution out there. The derobins version. From what I can tell, this is the official StackOverflow version. Seems like it doesn't support multiple editors on one page. JQuery.MarkEdit. Looks very good, but is pretty different from the StackOverflow version. MooWMD. Looks like the winner right now, but I'm a little concerned since it looks less active/hackable than MarkEdit. The wmd-new version. Not sure, looks like an old codebase without much use. The SocialSite branch. Seems like it's not for public use.

    Read the article

  • WMD markdown editor - HTML to Markdown conversion

    - by gg1
    I am using wmd markdown editor on a project and had a question: When I post the form containing the markdown text area, it (as expected) posts html to the server. However, say upon server-side validation something fails and I need to send the user back to edit their entry, is there anyway to refill the textarea with just the markdown and not the html? Since as I have it set up, the server only has access to the post data (which is in the form of html) so I can't seem to think of a way to do this. Any ideas? Preferably a non-javascript based solution. Update: I found an html to markdown converter called markdownify. I guess this might be the best solution for displaying the markdown back to the user...any better alternatives are welcome! Update 2: I found this post on SO and I guess there is an option to send the data to the server as markdown instead of html. Are there any downsides to simply storing the data as markdown in the database? What about displaying it back to the user (outside of an editor)? Maybe it would be best to post both versions (html AND markdown) to the server... SOLVED: I can simply use php markdown to convert the markdown to html serverside.

    Read the article

  • Browser dependent problem rendering WMD with Showdown.js?

    - by CMPalmer
    This should be easy (at least no one else seems to be having a similar problem), but I can't see where it is breaking. I'm storing Markdown'ed text in a database that is entered on a page in my app. The text is entered using WMD and the live preview looks correct. On another page, I'm retrieving the markdown text and using Showdown.js to convert it back to HTML client-side for display. Let's say I have this text: The quick **brown** fox jumped over the *lazy* dogs. 1. one 1. two 4. three 17. four I'm using this snippet of Javascript in my jQuery document ready event to convert it: var sd = new Attacklab.showdown.converter(); $(".ClassOfThingsIWantConverted").each(function() { this.innerHTML = sd.makeHtml($(this).html()); } I suspect this is where my problem is, but it almost works. In FireFox, I get what I expected: The quick brown fox jumped over the lazy dogs. one two three four But in IE (7 and 6), I get this: The quick brown fox jumped over the lazy dogs. 1. one 1. two 4. three 17. four So apparently, IE is stripping the breaks in my markdown code and just converting them to spaces. When I do a view source of the original code (prior to the script running), the breaks are there inside the container DIV. What am I doing wrong? UPDATE It is caused by the IE innerHTML/innerText "quirk" and I should have mentioned before that this one on an ASP.Net page using data bound controls - there are obviously a lot of different workarounds otherwise.

    Read the article

  • Why are these divs overlapping?

    - by acidzombie24
    I putting wmd on my website. After putting code in and giving it a spin i see this image below. How can i make the preview div not overlap with the textarea? -edit- the black is the css background of div wmd-preview some html <div id="wmd-editor" class="wmd-panel"><div id="wmd-button-bar"></div> <textarea id="wmd-input" name="body" rows="10" cols="89"></textarea> ... </div></form><div id="wmd-preview" class="wmd-panel"></div>

    Read the article

  • Which StackOverflow-style MarkDown (WMD) javascript editor should I use?

    - by Edan Maor
    Background I'm working on an application which requires user-entered content, and I've decided to use a StackOverflow-style MarkDown editor. After researching this topic for the last few days, I realize there are numerous forks of the base WMD editor, some with a few basic enhancements and some with serious differences from the StackOverflow one. Since this will be the heart of the application, I'd like to start with the best code base I can. I'd be happy if anyone can recommend which one of the many solutions out there best fits my needs. Below is requirements, plus what I've managed to find already. I'm hoping this question will help me decide which version to go with, and maybe help me discover a port out there that's an even better fit for my needs. The requirements for my project Live Preview Multiple editors on the same page (not know how many in advance, since the user can dynamically add another editing box). Ability to extend with extra buttons (I'd like a button to upload a picture, instead of just adding an img url). Ability to dynamically show/hide the edit box (and only see the preview box). Not an absolute must, but I'd prefer to stick as close to StackOverflow's look and feel, since it's well known. Don't know if this matters, but the backend is written in Django. Editors I've looked at Here are a few of the code bases I've looked at, with thoughts. Obviously, I might be missing another solution out there. The derobins version. From what I can tell, this is the official StackOverflow version. Seems like it doesn't support multiple editors on one page. JQuery.MarkEdit. Looks very good, but is pretty different from the StackOverflow version. MooWMD. Looks like the winner right now, but I'm a little concerned since it looks less active/hackable than MarkEdit. The wmd-new version. Not sure, looks like an old codebase without much use. The SocialSite branch. Seems like it's not for public use.

    Read the article

  • How to control allowed HTML tags in WMD Editor?

    - by Toto
    I am trying to some-how set the valid HTML tags and attributes users would be able to use in WMD Editor in my site. For example, I want to forbid the user to directly set the font size, color, typeface and so on, which is trivial to do with the default settings typing something like: <span style="font-size: 45px; color:#FF0000">Some intrusive text here</span>. I think the way to implement this is through the "wmd_options", but I have not found any documentation or reference regarding this, giving the fact that the 'Options demo' seems to be the only public documentation and it does not show how should I do what I have described above. I've send this same question to [email protected] but didn't get any reply. As stackoverflow uses this editor someone reading this or maybe Jeff knows the answer ;) Thanks in advance!

    Read the article

  • wmd editor sanitizing

    - by Ke
    hi, i am trying to find ways to sanitize the input of wmd editor Specifically, I am trying to make HTML tags only available in the <code>tags that wmd generates. Is that possible My problem is that the following code is rendered as html which is vunerable to potential xss attacks e.g. <a onmouseover="alert(1)" href="#">read this!</a> The above code renders normally both in preview mode and when saved to the db. I notice that SO doesnt seem to have this problem. The same code is just rendered as text. I notice that SO has shared their code here http://refactormycode.com/codes/333-sanitize-html Do I really have to use c# in order to sanitize wmd to do this? Any help appreciated , cheers Ke

    Read the article

  • Which WYSIWYM editor to use?

    - by AJ
    I need a WYSIWYM markdown editor for my web application and I heard WMD was the obvious choice. To my surprise WMD breaks in IE8. What other option do I have, or is there a version that's been tested on IE8 and is compatible?

    Read the article

  • display HTML content from database with formatting in it

    - by Gaurav Sharma
    Hi all, I have used wmd-editor in my cakephp v1.3 application. The config which I have written is as follows: wmd_options = { output: "HTML", lineLength: 40, buttons: "bold italic | link blockquote code image | ol ul heading hr", autostart: true }; When I submit the form the HTML in the wmd enabled textarea is saved in the database with htmlentities() done to the text then I am displaying it with html_entity_decode() method. but the text is displayed as it is including the HTML coding like this <p><strong>hello dear friends</strong></p>\n\n<pre><code>I want to make sure that everything that you type is visible clearly.\nadasfafas\n</code></pre>\n\n<blockquote>\n <p>sadgsagasdgxcbxcbxc</p>\n</blockquote>\n\n<p><em>sadfgsgasdsgasgs</em></p>\n\n<p><b><a href="http://kumu.in">this is the link</a></b></p> Please help me solve this problem Thanks

    Read the article

  • What's wrong with my markdown syntax? Broken in stackoverflow and bluecloth...

    - by nfm
    I just wrote some markdown and it doesn't seem to render correctly. Is it legal syntax to have an ordered list, followed by newlines, then followed by an unordered list? Or is this a bug in bluecloth? For example: 1. One 2. Two 3. Three * Apple * Banana * Carrot Bluecloth creates a single <ul> and nests apple, banana and carrot as <li>'s under it. Stackoverflow's post editor (wmd?) does this too. Am I just doing it wrong? Surely this is a common usage case...

    Read the article

  • Add some html to Zend Forms

    - by bluedaniel
    Hello everyone, Im looking for a simple bit of code that will let me add the following html into my zend form: <div id="wmd-button-bar" class="wmd-panel"></div> Thats it, it needs to be above my 'method' element in the form but thats it. For such a simple action I cant find any methods that don't involve me learning rocket science (i.e Zend Decorators).

    Read the article

1 2  | Next Page >