Precisely which type of markdown (afaik there are quite a few variants) and editor (the one I am typing in right now) is Stack Overflow using?
I understand, there must be a JavaScript realtime implementation (which shows me the preview below). Where could I get that?
I hope there's also a PHP implementation, so I can turn markdown into HTML in the backend?
Ultimately I want to turn a very proprietary wordpress theme into being markdown based, since I find this the exact right balance between complexity and ease of use. Many 'wiki syntaxes' are in my opinion off to one side or the other.
-
1The de facto standard Markdown library for PHP is PHP Markdown.user149432– user14943205/21/2012 08:54:23Commented May 21, 2012 at 8:54
-
1See We're switching to CommonMark. The answers here are (mostly) obsolete now. (They still use some of their own Markdown implementations for Stack-Exchange-specific features.)Sebastian Simon– Sebastian Simon06/25/2020 01:56:41Commented Jun 25, 2020 at 1:56
2 Answers 2
You're looking for:
- MarkdownSharp - C# Markdown processor
- pagedown - A JavaScript Markdown converter and editor
- prettify - A Javascript module and CSS file that allows syntax highlighting of source code snippets in an html page.
You can find the full supported Markdown syntax in the editing help page.
-
1Don't forget Jeff's HTML Sanitizer.Henrik Ripa– Henrik Ripa05/21/2012 08:26:41Commented May 21, 2012 at 8:26
-
Thank you. I also found something at michelf.com/projects/php-markdown (not yet tested about compatibility differences)Frank N– Frank N05/21/2012 12:22:31Commented May 21, 2012 at 12:22
StackExchange uses the MarkdownSharp implementation, written in C#. Converting it to php would likely be quite the task.
See also: Which tools and technologies build the Stack Exchange Network?