Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Extends the stackoverflow markdown editor to work as a jQuery plugin
JavaScript
branch: master

Plugin now finds necessary elements by:

    1) Look for jQuery DOM elements passed on initialization
    2) Look for sub-classes with expected class names
    3) Create DOM elements with unique ids
latest commit c58ddc5ff5
@arhpreston authored

README.md

jQuery Markdown

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

Usage

Include scripts in your html file:

  <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></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();
  });

Options

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'
  });
Something went wrong with that request. Please try again.