Skip to content

jpevarnek/to-markdown

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

to-markdown

An HTML to Markdown converter written in javascript.

A basic implementation is there, but it's not yet fully bulletproof (contributions welcome!).

Usage

Browser

to-markdown depends on he.js. Include both he.js and to-markdown:

<script src="PATH/TO/he.js"></script>
<script src="PATH/TO/to-markdown.js"></script>

<script>toMarkdown('<h1>Hello world</h1>')</script>

Bower

bower install to-markdown

Node.js

npm install to-markdown

var toMarkdown = require('to-markdown').toMarkdown;
toMarkdown('<h1>Hello world</h1>');

Unit tests

Node.js unit tests can be run with NodeUnit:

$ npm test

This will test both server-side and client-side tests (using zombie-qunit).

Known issues

There are a couple of known issues surrounding blockquotes in lists (and perhaps vice versa) — #2; and also how to handle HTML elements outside of the markdown subset (keep them/strip them?) — #3.

Licence

to-markdown is copyright © 2011-14 Dom Christie and released under the MIT license.

About

An HTML to Markdown converter written in JavaScript

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 94.1%
  • CSS 5.9%