markdown

Can I define a class name on paragraph using Markdown?

And if so, how? Thanks! ...

PHP Replace, But Alternate Replace String

Okay, here's what I'm trying to do: I'm trying to use PHP to develop what's essentially a tiny subset of a markdown implementation, not worth using a full markdown class. I need essentially do a str_replace, but alternate the replace string for every occurrence of the needle, so as to handle the opening and closing HTML tags. For examp...

How to retrieve BOTH the markdown and html using the wmd-editor control?

I am using WMD-Editor and would look to store both the Markdown and HTML version of the text that is entered. I can only seem to get access to the output as Markdown OR HTML, but not both. I am using ASP.NET MVC and am trying to get something like the following code to work ... just don't know how to get at the HTML. Here is a snipp...

How can I parse marked up text for further processing?

See updated input and output data at Edit-1. What I am trying to accomplish is turning + 1 + 1.1 + 1.1.1 - 1.1.1.1 - 1.1.1.2 + 1.2 - 1.2.1 - 1.2.2 - 1.3 + 2 - 3 into a python data structure such as [{'1': [{'1.1': {'1.1.1': ['1.1.1.1', '1.1.1.2']}, '1.2': ['1.2.1', '1.2.2']}, '1.3'], '2': {}}, ['3',]] I've looked ...

What are my options for working with markdown in ColdFusion?

I am seeing many many different use cases where I could use Markdown in apps that I write, both personal and professional. But from my research so far, I haven't been able to find many options for working with it in ColdFusion. I would certainly like to keep from reinventing the wheel by trying to implement it myself if someone else al...

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...

To change TYPE to nothing from conf in Vim

My syntax -highlighting is broken for a file which Type is conf as follows: File where the syntax highlighting does not work The syntax highlighting works for all other files with the extension .markdown. However, the only difference between these files is that the other files' type is nothing, while that of a file, which has bug, it...

wmd - markdown editor - how to assign it to an arbitrary text field?

If any of you have ever used wmd markdown editor (which is like the editor that stackoverflow uses) then maybe you are able to help me out: WMD by default assigns itself to the first textarea found on the page. However, I have a page with an arbitrary amount of textareas appearing before the one I need WMD assigned to. WMD provides o...

WMD markdown editor - HTML to Markdown conversion

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 a...

multiple wmd textareas on the same page

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 th...

Syntax highlighting with Markdown & Pygments in Django

I've been trying to get syntax highlighting working in my simple Django (1.1) test app using Markdown (2.0.1) & Pygments (1.0). The idea is to generate HTML from the users input which is in markdown format and store both in the DB so I don't have to do the markdown to html translation during the fetch. So far I have the markdown proce...

Is Markdown (with strip_tags) sufficient to stop XSS attacks?

I'm working on a web application that allows users to type short descriptions of items in a catalog. I'm allowing Markdown in my textareas so users can do some HTML formatting. My text sanitization function strips all tags from any inputted text before inserting it in the database: public function sanitizeText($string, $allowedTags = "...

How to switch web app from HTML to Markdown?

I've got a django-powered site. Currently, all of the textfields are just plain old text inputs that take raw HTML. I have no fancy editor or anything. I would like to start using Markdown and WMD to make things easier for everyone. Do I have to run some sort of script to go over every text field in the database to convert all the HTML...

Should i sanitize markdown?

For my post entity i store both HTML and MARKDOWN in database (HTML is converted from MARKDOWN). HTML is for rendering on page and MARKDOWN for editing ability (with WMD). I sanitize HTML before storing to db. Question is: should i sanitize markdown too? or it is xss-safe if i only pass it to wmd-editor? ...

What's the easiest way to convert an SO data dump from HTML back to Markdown?

I've just got my hands on a Stackoverflow data dump, and I'm disappointed to see that the Body field of the posts is in HTML rather than Markdown. I suspect there's Markdown in the original database because that's what I see if I try to edit an answer. I want to recover Markdown from a large set of answers. I will be processing hundre...

Javascript to convert Markdown/Textile to HTML (and, ideally, back to Markdown/Textile)

There are several good Javascript editors for Markdown / Textile (e.g.: http://attacklab.net/showdown/, the one I'm using right now), but all I need is a Javascript function that converts a string from Markdown / Textile -> HTML and back. What's the best way to do this? (Ideally it would be jQuery-friendly -- e.g., $("#editor").markdown...

Loading Markdownify in CodeIgniter

Hi, I downloaded Markdownify from http://milianw.de/projects/markdownify/ and extracted it to my application/libraries/ directory. I did a: $this->load->library('markdownify'); echo $this->markdownify->parseString('<b>Test</b>'); But the output is the same html markup. It didn’t work. How do I get it working? ...

MarkItUp! continous preview refresh without hitting enter

I'm using MarkItUp (http://markitup.jaysalvat.com/) and can't really figure out how to get it to continuously update the preview pane as each character is typed (or even when a 'space' is encountered). By default it refreshes the preview pane only when the enter key is hit. Is there any way to customize this behavior? The documentation...

Sanitize Markdown in Rails?

Users can edit "articles" in my application. Each article is mastered in the DB and sent to the client as Markdown -- I convert it to HTML client side with Javascript. I'm doing this so that when the user wants to edit the article he can edit and POST the Markdown right back to the server (since it's already on the page). My question i...

How do I know if I need to use a Markdown library?

I've been finding that a lot of Github projects use Markdown. I originally thought this library was only needed on sites like StackOverflow that include the ability for users to add comments or posts that might include source code snippets. But some apps seem to use Markdown even when this is not the case. Markdown is a lightweight ...