diff options
| author | kamtschatka <simon.schatka@gmx.at> | 2024-10-19 15:15:59 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-19 14:15:59 +0100 |
| commit | 6977ba76e1454c8fbf8740b8eab2ea49651375ed (patch) | |
| tree | b50b07d7dbd637a600071699e165453cedd3dfcd /apps/web/components | |
| parent | 4454d635fa4936f5d6d28718bb3c35eb1fd06261 (diff) | |
| download | karakeep-6977ba76e1454c8fbf8740b8eab2ea49651375ed.tar.zst | |
fix(web): Single linebreaks are lost when viewing textnote card. Fixes #549 (#551)
added remarkBreaks plugin to properly handle single newlines
Diffstat (limited to 'apps/web/components')
| -rw-r--r-- | apps/web/components/ui/markdown-component.tsx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/web/components/ui/markdown-component.tsx b/apps/web/components/ui/markdown-component.tsx index d567ddb3..d3c832ac 100644 --- a/apps/web/components/ui/markdown-component.tsx +++ b/apps/web/components/ui/markdown-component.tsx @@ -4,6 +4,7 @@ import { cn } from "@/lib/utils"; import Markdown from "react-markdown";
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
import { dracula } from "react-syntax-highlighter/dist/cjs/styles/prism";
+import remarkBreaks from "remark-breaks";
import remarkGfm from "remark-gfm";
function PreWithCopyBtn({ className, ...props }: React.ComponentProps<"pre">) {
@@ -28,7 +29,7 @@ export function MarkdownComponent({ }) {
return (
<Markdown
- remarkPlugins={[remarkGfm]}
+ remarkPlugins={[remarkGfm, remarkBreaks]}
className="prose dark:prose-invert"
components={{
pre({ ...props }) {
|
