Find file
Fetching contributors…
Cannot retrieve contributors at this time
38 lines (23 sloc) 1.08 KB

jQuery Markdown

Extends the stacakoverflow markdown editor to work as a jQuery plugin.


Include scripts in your html file:

  <script type="text/javascript" src=""></script>
  <script type="text/javascript" src="../markdown/Markdown.Converter.js"></script>
  <script type="text/javascript" src="../markdown/Markdown.Sanitizer.js"></script>
  <script type="text/javascript" src="../markdown/Markdown.Editor.js"></script>
  <script type="text/javascript" src="../markdown/jquery.markdown.js"></script>

Add a markdown holder:

  <div class="markdown-input"></div>

Initialize the editor:

  $(document).ready(function() {
        $( ".markdown-input" ).markdown();


The editor will accept predefined DOM elements and/or look for elements with the default classes (see tests for examples):

  $( ".markdown-input" ).markdown({
        'buttons'      : $( '#button-element-id' ),
        'previewClass' : 'markdown-preview'