Skip to content

mycolorway/simditor-markdown

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

simditor-markdown

Add a markdown editing button for Simditor. Use marked as markdown parser and to-markdown as HTML to markdown converter.

###Usage

Reference button and dependency script on your page with Simditor:

<script type="text/javascript" src="[path]/marked.js"></script>
<script type="text/javascript" src="[path]/to-markdown.js"></script>
<script type="text/javascript" src="[path]/simditor-markdown.js"></script>

<link rel="stylesheet" href="[path]/simditor-markdown.css" media="screen" charset="utf-8" />

Add markdown button config when you initialize Simditor:

var editor = new Simditor({
  textarea: $('#txt-editor'),
  toolbar: ['bold', 'italic', 'underline', 'color', '|', 'ol', 'ul', '|', 'markdown']
});

###Options

If you want to switch to markdown mode right after Simditor initialized, pass markdown: true to Simditor init options:

var editor = new Simditor({
  textarea: $('#txt-editor'),
  markdown: true,
  toolbar: ['bold', 'italic', 'underline', 'color', '|', 'ol', 'ul', '|', 'markdown']
});