Skip to content

Commit 7b014bd

Browse files
author
Evan Jacobs
committed
Add to README
1 parent d5d65d4 commit 7b014bd

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,32 @@ Enables the safe parsing of markdown into proper React JSX objects, so you don't
44

55
The only exception is arbitrary HTML in the markdown (kind of an antipattern), which will still use the unsafe method.
66

7+
Uses [mdast](https://github.com/wooorm/mdast) under the hood to parse markdown into a consistent AST format.
8+
79
Requires React >= 0.14.
810

11+
## Usage
12+
13+
```js
14+
import converter from 'markdown-to-jsx';
15+
import React from 'react';
16+
import {render} from 'react-dom';
17+
18+
render(converter('# Hello world!'), document.body);
19+
```
20+
21+
[mdast options](https://github.com/wooorm/mdast#mdastprocessvalue-options-done) can be passed as the second argument:
22+
23+
```js
24+
converter('# Hello world[^2]!\n\n[^2]: A beautiful place.', {footnotes: true});
25+
```
26+
27+
928
## Development Checklist
1029

1130
- [x] Base library
1231
- [x] Unit testing
13-
- [ ] Ship 1.0.0 to npm
32+
- [x] Ship 1.0.0 to npm
1433
- [ ] _stretch goal_ - don't use `dangerouslySetInnerHTML` for arbitrary HTML in the markdown
1534

1635
## Known Issues

0 commit comments

Comments
 (0)