Skip to content

Commit

Permalink
Use remarkBreaks for newlines
Browse files Browse the repository at this point in the history
  • Loading branch information
tomoya committed Oct 3, 2024
1 parent 4027e70 commit c23afad
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/web/app/routes/_index/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { MetaFunction } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
import Markdown from "react-markdown";
import remarkGfm from "remark-gfm";
import remarkBreaks from "remark-breaks";
import { indexLoader, type IndexLoader } from "./loader";

export const loader = indexLoader;
Expand Down Expand Up @@ -38,7 +39,9 @@ export default function Index() {
</Group>
</Stack>
<Paper p="md">
<Markdown remarkPlugins={[remarkGfm]}>{d.content}</Markdown>
<Markdown remarkPlugins={[remarkBreaks, remarkGfm]}>
{d.content}
</Markdown>
</Paper>
</Card>
))}
Expand Down
1 change: 1 addition & 0 deletions packages/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-markdown": "^9.0.1",
"remark-breaks": "^4.0.0",
"remark-gfm": "^4.0.0"
},
"devDependencies": {
Expand Down
20 changes: 20 additions & 0 deletions packages/web/pnpm-lock.yaml

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

0 comments on commit c23afad

Please sign in to comment.