Skip to content

Commit

Permalink
Fix: memo viewer Server content 데이터 적용하기 (tiptap/html generateHTML활용)
Browse files Browse the repository at this point in the history
  • Loading branch information
dongree committed Dec 6, 2023
1 parent 18b1b2b commit 57b7839
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 deletions.
43 changes: 43 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"@tiptap/extension-task-list": "^2.0.3",
"@tiptap/extension-text-style": "^2.0.3",
"@tiptap/extension-underline": "^2.0.3",
"@tiptap/html": "^2.1.13",
"@tiptap/pm": "^2.0.3",
"@tiptap/react": "^2.0.3",
"@tiptap/starter-kit": "^2.0.3",
Expand Down
6 changes: 4 additions & 2 deletions src/components/memo/MemoViewer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { generateHTML } from '@tiptap/react';
import { generateHTML } from '@tiptap/html';
import MemoViewerHeader from './MemoViewerHeader';
import { handleTiptapExtensions } from '@/components/editor/extensions';
import TagView from '../shared/TagView';
Expand Down Expand Up @@ -77,7 +77,9 @@ export default function MemoViewer({
<div className="h-[0.5px] mx-3 my-4 bg-soma-grey-49"></div>
<div
className="flex-grow max-w-full px-4 prose-sm break-all sm:prose-lg prose-headings:my-2 prose-p:my-0 prose-stone dark:prose-invert prose-headings:font-display font-default focus:outline-none"
dangerouslySetInnerHTML={{ __html: output }}
dangerouslySetInnerHTML={{
__html: output,
}}
></div>
<div className="flex flex-wrap gap-1 mx-2 mt-10 mb-1">
{memoTags.map((tag, idx) => (
Expand Down

0 comments on commit 57b7839

Please sign in to comment.