feat(markdown): Add target and rel attributes to anchor tags for improved security and forcing open in a new window

This commit is contained in:
Willie Zutz 2025-07-19 12:29:15 -06:00
parent 9f58910254
commit ea6f71d406
2 changed files with 5 additions and 1 deletions

View file

@ -149,6 +149,11 @@ const MarkdownRenderer = ({
pre: {
component: ({ children }) => children,
},
a: {
component: (props) => (
<a {...props} target='_blank' rel='noopener noreferrer' />
),
},
// Prevent rendering of certain HTML elements for security
iframe: () => null, // Don't render iframes
script: () => null, // Don't render scripts

View file

@ -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;
}