mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-04-08 08:39:36 -04:00
Fix
This commit is contained in:
@@ -65,6 +65,10 @@ export function getField(extension: AnyExtension, field: string) {
|
||||
* We can't use prosemirror node views (this is what tiptap `generateHTML` does) because it uses document which is on the client.
|
||||
*/
|
||||
export const generateReact = (doc: JSONContent, extensions: Extensions) => {
|
||||
if (!doc) {
|
||||
return null
|
||||
}
|
||||
|
||||
const extensionsIncludingStarterKit = extensions.flatMap(
|
||||
(e) => getField(e, 'addExtensions')?.() ?? e
|
||||
)
|
||||
|
||||
@@ -215,8 +215,6 @@ function RichContent(props: {
|
||||
}) {
|
||||
const { className, content, size = 'md' } = props
|
||||
|
||||
if (!content) return null
|
||||
|
||||
const jsxContent = useMemo(() => {
|
||||
try {
|
||||
return generateReact(content, [
|
||||
@@ -236,6 +234,8 @@ function RichContent(props: {
|
||||
}
|
||||
}, [content, size])
|
||||
|
||||
if (!content) return null
|
||||
|
||||
return (
|
||||
<div
|
||||
className={clsx(
|
||||
|
||||
Reference in New Issue
Block a user