Socket
Book a DemoInstallSign in
Socket

markdown-it-react-component

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

markdown-it-react-component

Plugin to support react component for markdown-it markdown parser

0.4.1-rc.2
Source
npmnpm
Version published
Weekly downloads
1
-50%
Maintainers
1
Weekly downloads
 
Created
Source

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.

Example

run npm run storybook

License

MIT

Keywords

markdown-it-plugin

FAQs

Package last updated on 17 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.