https://github.com/chalarangelo/parse-md-js
A regular expression Markdown parser, written in functional Javascript
https://github.com/chalarangelo/parse-md-js
Last synced: about 1 month ago
JSON representation
A regular expression Markdown parser, written in functional Javascript
- Host: GitHub
- URL: https://github.com/chalarangelo/parse-md-js
- Owner: Chalarangelo
- License: mit
- Created: 2017-03-21T13:45:21.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-24T15:31:36.000Z (about 8 years ago)
- Last Synced: 2025-03-30T17:51:14.463Z (2 months ago)
- Language: JavaScript
- Homepage: https://chalarangelo.github.io/parse-md-js/index.html
- Size: 6.84 KB
- Stars: 39
- Watchers: 3
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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 21. 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 `` syntax:
```
[link_title](https://github.com/Chalarangelo/parse-md-js)

```- **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.