Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@contentful/rich-text-from-markdown
Advanced tools
A library to convert markdown to Contentful Rich Text document format.
Using npm:
npm install @contentful/rich-text-from-markdown
Using yarn:
yarn add @contentful/rich-text-from-markdown
const { richTextFromMarkdown } = require('@contentful/rich-text-from-markdown');
const document = await richTextFromMarkdown('# Hello World');
The library will convert automatically the following markdown nodes:
paragraph
heading
text
emphasis
strong
delete
inlineCode
link
thematicBreak
blockquote
list
listItem
table
tableRow
tableCell
If the markdown content has unsupported nodes like image ![image](url)
you can add a callback as a second argument
and it will get called everytime an unsupported node is found. The return value of the callback will be the rich text representation
of that node.
const { richTextFromMarkdown } = require('@contentful/rich-text-from-markdown');
// define your own type for unsupported nodes like asset
const document = await richTextFromMarkdown(
"![image]('https://example.com/image.jpg')",
(node) => ({
nodeType: 'embedded-[entry|asset]-[block|inline]',
content: [],
data: {
target: {
sys: {
type: 'Link',
linkType: 'Entry|Asset',
id: '.........',
},
},
},
}),
);
FAQs
convert markdown to rich text
The npm package @contentful/rich-text-from-markdown receives a total of 49,264 weekly downloads. As such, @contentful/rich-text-from-markdown popularity was classified as popular.
We found that @contentful/rich-text-from-markdown demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.