markedjs-extra

0.0.3 • Public • Published

markedjs-extra

This repository began as a GitHub fork of chjj/marked This is a plugins to enable support for Markdown Extra syntax. Open demo/demo.html to try it yourself.

install

  • install with Bower: bower install markedjs-extra --save
  • install with npm: npm install marked-extra --save

Usage

Minimal usage:

var marked = require('marked');
console.log(marked('I am using __markdown__.'));
// Outputs: <p>I am using <strong>markdown</strong>.</p>

Example setting options with default values:

var marked = require('marked');
marked.setOptions({
  renderer: new marked.Renderer(),
  gfm: true,
  tables: true,
  extra: true,
  breaks: false,
  pedantic: false,
  sanitize: true,
  smartLists: true,
  smartypants: false
});
 
console.log(marked('I am using __markdown__.'));

Browser

<!doctype html>
<html>
<head>
  <meta charset="utf-8"/>
  <title>Marked in the browser</title>
  <script src="lib/marked.js"></script> 
</head>
<body>
  <div id="content"></div>
  <script>
    document.getElementById('content').innerHTML =
      marked('# Marked in browser\n\nRendered by **marked**.');
  </script> 
</body>
</html>

more details https://github.com/chjj/marked/blob/master/README.md

New Feature

(you should set the option extra true)

checkbox

The following markdown:

-[] test

will render to something like this depending on how you choose to style it: test

Definition Lists

The following markdown:

Term 1
:   Definition 1
 
Term 2
:   This definition has a code block.
 
        code block

will render to something like this depending on how you choose to style it:

Term 1
Definition 1
Term 2
This definition has a code block.
code block

Footnotes

Here is a footnote[^footnote].
 
  [^footnote]: Here is the *text* of the **footnote**.

Here is a footnote1.


  1. Here is the text of the footnote.

Package Sidebar

Install

npm i markedjs-extra

Weekly Downloads

1

Version

0.0.3

License

MIT

Last publish

Collaborators

  • xiaoliwang