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.
@contember/react-richtext-renderer
Advanced tools
This package provides a React renderer for Contember Rich Text format.
yarn add @contember/react-richtext-renderer
import { RichTextBlocksRenderer } from '@contember/react-richtext-renderer'
const App = () => {
const blocks = [] // blocks from Contember API
return (
<RichTextBlocksRenderer
blocks={blocks}
sourceField={'content'}
referencesField={'references'}
referenceDiscriminationField={'type'}
/>
)
}
import { RichTextFieldRenderer } from '@contember/react-richtext-renderer'
const App = () => {
const value = {} // value from Contember API
return (
<RichTextFieldRenderer
source={value}
/>
)
}
import { RichTextBlocksRenderer } from '@contember/react-richtext-renderer'
const App = () => {
// ...
return (
<RichTextBlocksRenderer
// ...
renderElement={it => {
if (it.element.type === 'blockquote') {
return <blockquote>{it.children}</blockquote>
}
return it.fallback
}}
/>
)
}
import { RichTextBlocksRenderer } from '@contember/react-richtext-renderer'
const App = () => {
// ...
return (
<RichTextBlocksRenderer
// ...
renderLeaf={it => {
if (it.leaf.isSup) {
return <sup>{it.fallback}</sup>
}
return it.fallback
}}
/>
)
}
Make sure to use it.fallback
instead of it.children
in renderLeaf
callback, to render already applied leafs as well.
import { RichTextBlocksRenderer } from '@contember/react-richtext-renderer'
const App = () => {
// ...
return (
<RichTextBlocksRenderer
// ...
referenceRenderers={{
image: ({ reference }) => <img src={reference.url} />,
}}
/>
)
}
FAQs
Unknown package
The npm package @contember/react-richtext-renderer receives a total of 735 weekly downloads. As such, @contember/react-richtext-renderer popularity was classified as not popular.
We found that @contember/react-richtext-renderer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 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 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.