diff --git a/client/package.json b/client/package.json index 182aaa9..3cc5939 100644 --- a/client/package.json +++ b/client/package.json @@ -6,7 +6,6 @@ "@monaco-editor/react": "^4.6.0", "date-fns": "^4.1.0", "framer-motion": "^11.11.9", - "linkify-react": "^4.1.3", "lucide-react": "^0.452.0", "monaco-editor": "^0.52.0", "parse-duration": "^1.1.0", diff --git a/client/src/components/snippets/list/SnippetCard.tsx b/client/src/components/snippets/list/SnippetCard.tsx index 0f01125..ab17571 100644 --- a/client/src/components/snippets/list/SnippetCard.tsx +++ b/client/src/components/snippets/list/SnippetCard.tsx @@ -5,8 +5,7 @@ import { ConfirmationModal } from '../../common/modals/ConfirmationModal'; import { Snippet } from '../../../types/snippets'; import CategoryList from '../../categories/CategoryList'; import { PreviewCodeBlock } from '../../editor/PreviewCodeBlock'; -import Linkify from 'linkify-react'; -import { linkifyOptions } from '../../../constants/linkify'; +import ReactMarkdown from 'react-markdown'; import { formatDistanceToNow } from 'date-fns'; import { getUniqueLanguages } from '../../../utils/language/languageUtils'; @@ -174,10 +173,10 @@ export const SnippetCard: React.FC = ({ {!compactView && ( -

- +

+ {snippet.description || 'No description available'} - +

)} diff --git a/client/src/components/snippets/view/FullCodeView.tsx b/client/src/components/snippets/view/FullCodeView.tsx index 2af4c85..ac781b2 100644 --- a/client/src/components/snippets/view/FullCodeView.tsx +++ b/client/src/components/snippets/view/FullCodeView.tsx @@ -5,8 +5,7 @@ import { Snippet } from '../../../types/snippets'; import CategoryList from '../../categories/CategoryList'; import { getLanguageLabel, getUniqueLanguages } from '../../../utils/language/languageUtils'; import { FullCodeBlock } from '../../editor/FullCodeBlock'; -import Linkify from 'linkify-react'; -import { linkifyOptions } from '../../../constants/linkify'; +import ReactMarkdown from 'react-markdown'; interface FullCodeViewProps { showTitle?: boolean; @@ -73,9 +72,9 @@ export const FullCodeView: React.FC = ({ {/* Description */}
- + {snippet.description || 'No description available'} - +
{/* Categories */} diff --git a/client/src/constants/linkify.ts b/client/src/constants/linkify.ts deleted file mode 100644 index 50e865d..0000000 --- a/client/src/constants/linkify.ts +++ /dev/null @@ -1,9 +0,0 @@ -export const linkifyOptions = { - defaultProtocol: 'https', - target: '_blank', - rel: 'noopener noreferrer', - className: 'text-blue-400 hover:text-blue-300 transition-colors duration-200 underline decoration-blue-400/50 hover:decoration-blue-300 cursor-pointer', - validate: { - url: (_: any) => true - } -}; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index f5ad544..f042265 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,7 +35,6 @@ "@monaco-editor/react": "^4.6.0", "date-fns": "^4.1.0", "framer-motion": "^11.11.9", - "linkify-react": "^4.1.3", "lucide-react": "^0.452.0", "monaco-editor": "^0.52.0", "parse-duration": "^1.1.0", @@ -6419,23 +6418,6 @@ "dev": true, "license": "MIT" }, - "node_modules/linkify-react": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/linkify-react/-/linkify-react-4.1.3.tgz", - "integrity": "sha512-rhI3zM/fxn5BfRPHfi4r9N7zgac4vOIxub1wHIWXLA5ENTMs+BGaIaFO1D1PhmxgwhIKmJz3H7uCP0Dg5JwSlA==", - "license": "MIT", - "peerDependencies": { - "linkifyjs": "^4.0.0", - "react": ">= 15.0.0" - } - }, - "node_modules/linkifyjs": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/linkifyjs/-/linkifyjs-4.1.3.tgz", - "integrity": "sha512-auMesunaJ8yfkHvK4gfg1K0SaKX/6Wn9g2Aac/NwX+l5VdmFZzo/hdPGxEOETj+ryRa4/fiOPjeeKURSAJx1sg==", - "license": "MIT", - "peer": true - }, "node_modules/locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", @@ -7708,9 +7690,9 @@ } }, "node_modules/nanoid": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", - "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", "funding": [ { "type": "github",