From ea6f71d406c0bff330e21af0d501f382f7aca855 Mon Sep 17 00:00:00 2001 From: Willie Zutz Date: Sat, 19 Jul 2025 12:29:15 -0600 Subject: [PATCH] feat(markdown): Add target and rel attributes to anchor tags for improved security and forcing open in a new window --- src/components/MarkdownRenderer.tsx | 5 +++++ src/components/ThinkBox.tsx | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/MarkdownRenderer.tsx b/src/components/MarkdownRenderer.tsx index bbddde7..2f18762 100644 --- a/src/components/MarkdownRenderer.tsx +++ b/src/components/MarkdownRenderer.tsx @@ -149,6 +149,11 @@ const MarkdownRenderer = ({ pre: { component: ({ children }) => children, }, + a: { + component: (props) => ( + + ), + }, // Prevent rendering of certain HTML elements for security iframe: () => null, // Don't render iframes script: () => null, // Don't render scripts diff --git a/src/components/ThinkBox.tsx b/src/components/ThinkBox.tsx index edfd7ab..c54ea4e 100644 --- a/src/components/ThinkBox.tsx +++ b/src/components/ThinkBox.tsx @@ -12,7 +12,6 @@ interface ThinkBoxProps { const ThinkBox = ({ content, expanded, onToggle }: ThinkBoxProps) => { // Don't render anything if content is empty - console.log('ThinkBox content:', content); if (!content) { return null; }