
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
@shinetools/rich-text-react-renderer
Advanced tools
React renderer for the Contentful rich text field type.
React renderer for the Contentful rich text field type.
Using npm:
npm install @contentful/rich-text-react-renderer
Using yarn:
yarn add @contentful/rich-text-react-renderer
import { documentToReactComponent } from '@contentful/rich-text-react-renderer';
const document = {
nodeType: 'document',
content: [
{
nodeType: 'paragraph',
content: [
{
nodeType: 'text',
value: 'Hello world!',
marks: [],
},
],
},
],
};
documentToReactComponent(document); // -> <p>Hello world!</p>
import { documentToReactComponent } from '@contentful/rich-text-react-renderer';
const document = {
nodeType: 'document',
content: [
{
nodeType: 'paragraph',
content: [
{
nodeType: 'text',
value: 'Hello',
marks: [{ nodeType: 'bold' }],
},
{
nodeType: 'text',
value: ' world!',
marks: [{ nodeType: 'italic' }],
},
],
},
],
};
documentToReactComponent(document); // -> <p><b>Hello</b><u> world!</u></p>
You can also pass custom renderers for both marks and nodes as an optional parameter like so:
import { BLOCKS.PARAGRAPH, MARKS.BOLD } from '@contentful/rich-text-types';
import { documentToReactComponent } from '@contentful/rich-text-react-renderer';
const document = {
nodeType: 'document',
content: [
{
nodeType: 'paragraph',
content: [
{
nodeType: 'text',
value: 'Hello',
marks: [{ nodeType: 'bold' }]
},
{
nodeType: 'text',
value: ' world!',
marks: [{ nodeType: 'italic' }]
},
],
},
]
};
const options = {
renderMark: {
[MARKS.BOLD]: text => `<custom-bold>${text}<custom-bold>`
},
renderNode: {
[BLOCKS.PARAGRAPH]: (node, next) => `<custom-paragraph>${next(node.content)}</custom-paragraph>`
}
}
documentToReactComponent(document, options);
// -> <custom-paragraph><custom-bold>Hello</custom-bold><u> world!</u></custom-paragraph>
Last, but not least, you can pass a custom rendering component for an embedded entry:
import { BLOCKS.EMBEDDED_ENTRY } from '@contentful/rich-text-types';
import { documentToReactComponent } from '@contentful/rich-text-react-renderer';
const document = {
nodeType: 'document',
content: [
{
nodeType: 'embedded-entry-block',
data: {
target: (...)Link<'Entry'>(...);
},
},
]
};
const options = {
renderNode: {
[BLOCKS.EMBEDDED_ENTRY]: (node) => `<custom-component>${customComponentRenderer(node)}</custom-component>`
}
}
documentToReactComponent(document, options);
// -> <custom-component>(...)Link<'Entry'>(...)</custom-component>
The renderNode keys should be one of the following BLOCKS and INLINES properties as defined in @contentful/rich-text-types:
BLOCKS
DOCUMENTPARAGRAPHHEADING_1HEADING_2HEADING_3HEADING_4HEADING_5HEADING_6UL_LISTOL_LISTLIST_ITEMQUOTEHREMBEDDED_ENTRYEMBEDDED_ASSETINLINES
EMBEDDED_ENTRY (this is different from the BLOCKS.EMBEDDED_ENTRY)HYPERLINKENTRY_HYPERLINKASSET_HYPERLINKThe renderMark keys should be one of the following MARKS properties as defined in @contentful/rich-text-types:
BOLDITALICUNDERLINECODEFAQs
React renderer for the Contentful rich text field type.
The npm package @shinetools/rich-text-react-renderer receives a total of 0 weekly downloads. As such, @shinetools/rich-text-react-renderer popularity was classified as not popular.
We found that @shinetools/rich-text-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
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.