Code Monkey home page Code Monkey logo

parse-md-js's Introduction

Parse-MD.js

A regular expression Markdown parser, written in functional Javascript.

Usage

Include the javascript file in your page, then simply call parseMarkdown:

var parsedMD = parseMarkdown(yourMarkdownVar);

The parser will parse the contents of yourMarkdownVar into parsedMD as HTML.

Recognized Syntax

  • Headers are only available using the # syntax:
# Heading 1
## Heading 2
### Heading 3
  • Italics and bold are available using asterisks:
*Italics* and **bold**
  • Unordered lists are available using either - or + and ordered lists are available using 1., 2. etc:
 - Unordered list item 1
 + Unordered list item 2

 1. Ordered list item 1
 2. Ordered list item 2

Note that list nesting is not supported and might cause unexpected behavior.

  • Links are only available using the [title](link_url) syntax and images are only available using the ![title](image_url) syntax:
[link_title](https://github.com/Chalarangelo/parse-md-js)
![image_tite](https://github.com/Chalarangelo/parse-md-js/image.png)
  • Inline code can be written using the ` symbol and code blocks are only available using single tab indentation:
`code goes here`

	code block
  • Single line blockquotes are available using the > symbol:
> blockquote
  • Horizontal rules are available using either --- or ===:
 ---
 ===
  • Line breaks are only supported using two or more newline characters.

  • Tables, inline HTML and Youtube vide embedding are not supported.

License

The source code is licensed under the MIT license.

parse-md-js's People

Contributors

chalarangelo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

parse-md-js's Issues

Parser doesn't honour escape sequences

The parseMarkdown function ignores escape backslashes. Passing this is a \*test\* to the function will return <p>this is a <em>test</em></p>. According to the specs, a backslash should be used to escape characters and render them literally, so the output should be <p>this is a *test*</p>.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.