
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
react-showdown2
Advanced tools
Forked from jerolimov/react-showdown. Render React components within markdown and markdown as React components!
Forked from jerolimov/react-showdown
Render React components within markdown and markdown as React components!
npm install --save react-showdown2
Really simple markdown example with ES6/JSX:
import { Markdown } from 'react-showdown2';
render: () => {
var markdown = '# Hello\n\nMore content...';
return <Markdown markup={ markdown } />
}
Use a React component and use it within the markdown with ES6/JSX:
import { Markdown } from 'react-showdown2';
const MyComponent extends Component {
render() {
return React.createElement(this.props.tag, null, this.props.children);
}
};
render: () => {
var markdown = '# Hello\n\n<MyComponent tag="strong">More Content...</MyComponent>';
return <Markdown markup={ markdown } components={{ MyComponent }} />
}
Really simple markdown example:
var Converter = require('react-showdown2').Converter;
var converter = new Converter();
var markdown = '# Hello\n\nMore content...';
var reactElement = converter.convert(markdown);
Use a React component and use it within the markdown:
var createClass = require('create-react-class');
var MyComponent = createClass({
render: function() {
return React.createElement(this.props.tag, null, this.props.children);
}
});
var Converter = require('react-showdown2').Converter;
var converter = new ReactShowdown.Converter({ components: { 'MyComponent': MyComponent }});
var markdown = '# Hello\n\n<MyComponent tag="strong">More Content...</MyComponent>';
var reactElement = converter.convert(markdown);
Converter options will be pushed forward to the showdown converter, please checkout the valid options section.
Just the components option is managed by this converter.
It define the component name (tag name) to component React class definition
(instance of createClass) mapping. See example above.
Project is based on the markdown parser Showdown and the "forgiving" htmlparser2.
FAQs
Forked from jerolimov/react-showdown. Render React components within markdown and markdown as React components!
We found that react-showdown2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.