New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
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.5.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12
decreased by-20%
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.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

Keywords

FAQs

Package last updated on 31 May 2020

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc