Skip to content

A fully featured Textile parser in JavaScript

License

Notifications You must be signed in to change notification settings

sronsiek/textile-js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

textile.js

Attempt at an implementation of fully featured Textile parser in JavaScript that runs reasonably fast and mostly avoids outputting broken HTML.

Give it a go in a live textile web editor.

Install

$ npm install textile-js

Options

The basic interface mimics marked, the popular markdown parser. So if you use that in your project then you can support Textile as well with minimal effort.

Currently, the only supported option is breaks which can be used to enable/disable the default behavior of line-breaking single newlines within blocks.

Usage

console.log( textile( "I am using __textile__." ) );

You can also get to the syntax tree, which uses JsonML.

var jsonml = textile.parse( text );
console.log( jsonml );

CLI

$ textile -o hello.html
hello world
^D
$ cat hello.html
<p>hello world</p>

License

Copyright © 2012, Borgar Þorsteinsson (MIT License).

See LICENSE.

About

A fully featured Textile parser in JavaScript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published