0.5.8 • Published 4 years ago

markdown-it-react-component v0.5.8

Weekly downloads
34
License
MIT
Repository
github
Last release
4 years ago

markdown-it-react-component

Plugin to support react component for markdown-it markdown parser

With this plugin you can support react component like:

``` rc
function Hello(props){
    return (
        <div>
            Hello:
            <p style={{color:'red'}}>{props.text}</p>
        </div>
    )
}
return (
    <div>
        <Hello text="World"/>
    </div>
);
## Installation

Only browser:

```bash
$ npm install markdown-it-react-component --save

API

import MarkdownIt from "markdown-it";
import { SupportReactComponent } from "markdown-it-react-component";

const md = new MarkdownIt().use(md => SupportReactComponent(md,[, options]))

Params

  • options:
    • sandbox - optional,sandbox to provide plugin,such as React Component.
    • babelOptions - optional,Babel Options,defalut:
      {
        presets: ['stage-3', 'react', 'es2015'],
        plugins: ['filterXSS']
      }
    • babelInit - optional,Babel initialization callback.
    • enableSSR - optional,Whether to enable SSR rendering.defalut:true
    • allowErrorLog - optional,Whether log the info of render react code error.defalut:false

Example

run npm run storybook

Test

run npm run test

License

MIT

0.5.8

4 years ago

0.5.7

4 years ago

0.5.4

4 years ago

0.5.3

4 years ago

0.5.2

4 years ago

0.5.1

5 years ago

0.5.0

5 years ago

0.4.4

5 years ago

0.4.2

5 years ago

0.4.1

5 years ago

0.4.1-reactrule

5 years ago

0.4.1-reactRule

5 years ago

0.4.1-rc.5

5 years ago

0.4.1-rc.4

5 years ago

0.4.1-rc.3

5 years ago

0.4.1-rc.2

5 years ago

0.4.1-rc.1

5 years ago

0.4.0

5 years ago

0.3.6

5 years ago

0.3.5

5 years ago

0.3.4

5 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.1.0-beta.1

6 years ago