Enhance LearningMaterialViewer and TaskWorkspace components to open links in a new tab with appropriate security attributes. This improves user experience by ensuring external links are handled safely.
Some checks are pending
platform/bro-js/challenge-pl/pipeline/head Build queued...

This commit is contained in:
2025-12-15 21:30:50 +03:00
parent 842bb959ab
commit 4fd2e5660c
2 changed files with 18 additions and 2 deletions

View File

@@ -234,7 +234,14 @@ export const LearningMaterialViewer = ({
} }
}} }}
> >
<ReactMarkdown remarkPlugins={[remarkGfm]}> <ReactMarkdown
remarkPlugins={[remarkGfm]}
components={{
a: ({ node: _node, ...props }) => (
<a {...props} target="_blank" rel="noopener noreferrer" />
)
}}
>
{pages[currentPage]} {pages[currentPage]}
</ReactMarkdown> </ReactMarkdown>
</Box> </Box>

View File

@@ -274,7 +274,16 @@ export const TaskWorkspace = ({ task, onTaskComplete, onTaskSkip }: TaskWorkspac
} }
}} }}
> >
<ReactMarkdown remarkPlugins={[remarkGfm]}>{task.description}</ReactMarkdown> <ReactMarkdown
remarkPlugins={[remarkGfm]}
components={{
a: ({ node: _node, ...props }) => (
<a {...props} target="_blank" rel="noopener noreferrer" />
)
}}
>
{task.description}
</ReactMarkdown>
</Box> </Box>
</Box> </Box>