Skip to content

Commit

Permalink
fix(ask-ai): dont render as markdown, remove markdown element instead
Browse files Browse the repository at this point in the history
  • Loading branch information
tfkhdyt committed Jul 7, 2024
1 parent 86a7053 commit 462ef46
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"react-photo-view": "^1.2.6",
"react-scroll-into-view": "^2.1.3",
"react-show-more-text": "^1.7.1",
"remove-markdown": "^0.5.0",
"sharp": "^0.33.4",
"slugify": "^1.6.6",
"superjson": "^2.2.1",
Expand All @@ -90,6 +91,7 @@
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@types/react-show-more-text": "^1.4.5",
"@types/remove-markdown": "^0.3.4",
"@typescript-eslint/eslint-plugin": "^7.15.0",
"@typescript-eslint/parser": "^7.15.0",
"autoprefixer": "^10.4.19",
Expand Down
16 changes: 16 additions & 0 deletions pnpm-lock.yaml

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

8 changes: 4 additions & 4 deletions src/app/_components/modals/ask-ai-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import clsx from 'clsx';
import type { Session } from 'next-auth';
import Link from 'next/link';
import { type ReactNode, useState } from 'react';
import Markdown from 'react-markdown';
import removeMd from 'remove-markdown';

import { badgeVariants } from '@/components/ui/badge';
import {
Expand Down Expand Up @@ -169,9 +169,9 @@ export function AskAIModal({
.with(false, () => {
if (data) {
return (
<Markdown className='whitespace-pre-wrap text-left text-sm leading-relaxed max-h-52 overflow-y-auto'>
{data}
</Markdown>
<div className='whitespace-pre-wrap text-left text-sm leading-relaxed max-h-52 overflow-y-auto'>
{removeMd(data)}
</div>
);
}
})
Expand Down

0 comments on commit 462ef46

Please sign in to comment.