moonprism-markdown

2.5.4 • Public • Published

Markdown.js

GitHub Workflow Status GitHub file gzip size in bytes

NPM

a simple markdown parser for JavaScript. demo

Syntax

  • Span Elements
auto link: <http://example.com/>
[This link](http://example.net/) has no title attribute.
![Alt text](/path/to/img.jpg)
*italicize*
`inline code`
**bold**
~~strikethrough~~
  • Headers
# h1 {#heading-id}
## h2
### h3
  • Lists
1. Step 1
    * requirements
```sh
pip3 install --user
```
    * build
        1. make link
> blockquote, hh
        2. make build
    * delete
2. Step 2
    1. first

- [x] task1
- [ ] task2
  • Blockquotes
> blockquote
next line

>[success] blockquote
>> next block
>> * list 1
>> * list 2
>>   ```
code in list
```
>
> next line
  • Code
```go
package main

func main() {
    println('mdzz')
}
```
  • Table
 left align | right align | center 
 :------| ------: | :------: 
 AND | 0 | 1 
 0 | 0 | 0 
 1 | 0 | 1 
  • HTML
<svg width="99" height="99">
  <circle cx="50" cy="50" r="40" stroke="black" stroke-width="2" fill="#d89cf6"/>
</svg>

Install

npm install moonprism-markdown --save

Usage

import markdown from 'moonprism-markdown'
let html = markdown('# hello world')

or download markdown.min.js, and import file in your page.

<script type="text/javascript" src="./markdown.min.js"></script>
<script type="text/javascript">
    var html = markdown('# hello world')
</script>

Config

markdown('# hello world', {
    debug: true,
    imageCDN: 'https://cdn.xx/',
    linkTargetBlank: true
})

Readme

Keywords

Package Sidebar

Install

npm i moonprism-markdown

Weekly Downloads

0

Version

2.5.4

License

MIT

Unpacked Size

31.3 kB

Total Files

33

Last publish

Collaborators

  • moonprism