Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
markdown-it-react-renderer
Advanced tools
Markdown to React Component converter.
This project uses Markdown parser from Markdown It library, but loosely supports its plugins.
import MDReactComponent from 'markdown-react-js';
...
render() {
return (
<MDReactComponent text='Some text **with emphasis**.' />
);
}
or, using function instead of component:
import { mdReact } from 'markdown-react-js';
...
render() {
return mdReact()('Some text **with emphasis**.');
}
Result:
<span>
<p>
Some text with <strong>emphasis</strong>.
</p>
</span>
const TAGS = {
html: 'span', // root node, replaced by default
strong: 'b',
em: 'i'
}
...
render() {
return (
<MDReactComponent text='Some **bold** and *italic* text.' tags={TAGS} />
);
}
Result:
<span>
<p>
Some <b>bold</b> and <i>italic</i> text.
</p>
</span>
function handleIterate(Tag, props, children, level) {
if (level === 1) {
props = {
...props,
className: 'first-level-class'
};
}
if (Tag === 'a') {
props = {
...props,
className: 'link-class',
href: props.href.replace('SOME_URL', 'http://example.com')
};
}
return <Tag {...props}>{children}</Tag>;
}
...
render() {
return (
<MDReactComponent text='[This link](SOME_URL) has it’s own style.' onIterate={handleIterate} />
);
}
Result:
<span>
<p class="first-level-class">
<a href="http://example.com" class="link-class">This link</a> has it’s own style.
</p>
</span>
Forked from
markdown-react-js Copyright 2015 Alexander Kuznetsov alexkuz@gmail.com
Markdown-it Copyright (c) 2014 Vitaly Puzrin vitaly@rcdesign.ru, Alex Kocharin alex@kocharin.ru
MIT
0.1.0 - 2016-02-07
:boom:
FAQs
React renderer for Markdown-it
The npm package markdown-it-react-renderer receives a total of 2 weekly downloads. As such, markdown-it-react-renderer popularity was classified as not popular.
We found that markdown-it-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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.