
Product
Introducing Module Reachability: Focus on the Vulnerabilities That Matter
Module Reachability filters out unreachable CVEs so you can focus on vulnerabilities that actually matter to your application.
commonmark-react-renderer
Advanced tools
Renderer for CommonMark which returns an array of React elements, ready to be used in a React component. See react-markdown for such a component.
npm install --save commonmark-react-renderer
var CommonMark = require('commonmark');
var ReactRenderer = require('commonmark-react-renderer');
var parser = new CommonMark.Parser();
var renderer = new ReactRenderer();
var input = '# This is a header\n\nAnd this is a paragraph';
var ast = parser.parse(input);
var result = renderer.render(ast);
// `result`:
[
<h1>This is a header</h1>,
<p>And this is a paragraph</p>
]
Pass an object of options to the renderer constructor to configure it. Available options:
sourcePos
- boolean Setting to true
will add data-sourcepos
attributes to all elements, indicating where in the markdown source they were rendered from (default: false
).escapeHtml
- boolean Setting to true
will escape HTML blocks, rendering plain text instead of inserting the blocks as raw HTML (default: false
).skipHtml
- boolean Setting to true
will skip inlined and blocks of HTML (default: false
).softBreak
- string Setting to br
will create <br>
tags instead of newlines (default: \n
).allowedTypes
- array Defines which types of nodes should be allowed (rendered). (default: all types).disallowedTypes
- array Defines which types of nodes should be disallowed (not rendered). (default: none).git clone git@github.com:rexxars/commonmark-react-renderer.git
cd commonmark-react-renderer
npm install
npm test
MIT-licensed. See LICENSE.
2.1.0 - 2015-11-20
allowTypes
/disallowedTypes
(Espen Hovlandsdal)FAQs
React renderer for CommonMark (rationalized Markdown)
The npm package commonmark-react-renderer receives a total of 9,890 weekly downloads. As such, commonmark-react-renderer popularity was classified as popular.
We found that commonmark-react-renderer 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.
Product
Module Reachability filters out unreachable CVEs so you can focus on vulnerabilities that actually matter to your application.
Product
Socket is introducing a new way to organize repositories and apply repository-specific security policies.
Research
Security News
Socket researchers uncovered malicious npm and PyPI packages that steal crypto wallet credentials using Google Analytics and Telegram for exfiltration.