Fix type-check issues

This commit is contained in:
2025-05-18 16:36:20 +02:00
parent 3619cf4ed4
commit 60ab01b0c8
11 changed files with 41 additions and 38 deletions

View File

@@ -55,7 +55,9 @@ const MarkdownPreview: React.FC<MarkdownPreviewProps> = ({
const [filePath] = decodeURIComponent(
href.replace(`${baseUrl}/internal/`, '')
).split('#');
handleFileSelect(filePath);
if (filePath) {
handleFileSelect(filePath);
}
} else if (href.startsWith(`${baseUrl}/notfound/`)) {
// For non-existent files, show a notification
const fileName = decodeURIComponent(
@@ -105,9 +107,6 @@ const MarkdownPreview: React.FC<MarkdownPreviewProps> = ({
</a>
),
code: ({ children, className, ...props }: MarkdownCodeProps) => {
const language = className
? className.replace('language-', '')
: null;
return (
<pre className={className}>
<code {...props}>{children}</code>