Skip to content

Commit

Permalink
removing markdown check
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobryas4 committed Sep 28, 2023
1 parent 0b4d488 commit 57ed852
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/components/current/Markdown.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
import React, { ReactNode } from 'react';
import ReactMarkdown from 'react-markdown';

//======================================
export const Markdown = ({ children }: { children: string }) => {
// regex to match URLs in text that arent already formatted as links in markdown
const urlRegex = /(?<!\]\()https?:\/\/[^\s]+(?!\))/g;

// add markdown syntax to format links in text if they aren't already marked
const processedText = children.replace(urlRegex, (url) => `[${url}](${url})`);

return (
<ReactMarkdown
components={{
Expand All @@ -19,7 +12,7 @@ export const Markdown = ({ children }: { children: string }) => {
code: (props) => <code className="text-orange-300" {...props} />,
}}
>
{processedText}
{children}
</ReactMarkdown>
);
};

0 comments on commit 57ed852

Please sign in to comment.