-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to render content as article page after edit ? #456
Comments
Here’s the method I used
export default function ContentRenderer({ json }: { json: any }) {
const output = useMemo(() => {
return generateHTML(json, [
Bold,
BulletList,
Document,
Heading,
Link,
Paragraph,
ListItem,
Text,
]);
}, [json]);
return (
<pre>
<div dangerouslySetInnerHTML={{__html:output}}></div>
</pre>
);
}
<div className="tiptap ProseMirror prose prose-lg dark:prose-invert prose-headings:font-title font-default focus:outline-none max-w-full">
<ContentRenderer json={value} />
</div> |
I think there is a better way to do that by using |
@keyproco Could you elaborate on how to use |
is there any way to do it on the server-side? |
Describe the feature you'd like to request
how to render content as article page after edit ?
Describe the solution you'd like to see
the editing result is the JSON , now I need save it to the DB... my question is how to render it back to web page later and keep the format like i see in the editor?
Additional information
No response
The text was updated successfully, but these errors were encountered: