Skip to content

Commit

Permalink
reverting markdown change
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobryas4 committed Sep 28, 2023
1 parent 527ae27 commit cd7e1a5
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/components/current/Markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ 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 +13,7 @@ export const Markdown = ({ children }: { children: string }) => {
code: (props) => <code className="text-orange-300" {...props} />,
}}
>
{processedText}
{children}
</ReactMarkdown>
);
};

0 comments on commit cd7e1a5

Please sign in to comment.