Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@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 729 weekly downloads. As such, @contember/react-richtext-renderer popularity was classified as not popular.
We found that @contember/react-richtext-renderer demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.