Release: Merge develop to main (111 commits) #302
@@ -56,14 +56,20 @@ function parseWikiLinks(html: string): string {
|
||||
const trimmedSlug = slug.trim();
|
||||
const text = displayText?.trim() ?? trimmedSlug;
|
||||
|
||||
// Validate slug contains only safe characters
|
||||
if (!/^[a-zA-Z0-9\-_./]+$/.test(trimmedSlug)) {
|
||||
// Invalid slug - return original text without creating a link
|
||||
return escapeHtml(match);
|
||||
}
|
||||
|
||||
// Create a styled link
|
||||
// Using data-wiki-link attribute for styling and click handling
|
||||
return `<a
|
||||
return `<a
|
||||
href="/knowledge/${encodeURIComponent(trimmedSlug)}"
|
||||
data-wiki-link="true"
|
||||
data-slug="${encodeURIComponent(trimmedSlug)}"
|
||||
class="wiki-link text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-300 underline decoration-dotted hover:decoration-solid transition-colors"
|
||||
title="Go to ${trimmedSlug}"
|
||||
title="Go to ${escapeHtml(trimmedSlug)}"
|
||||
>${escapeHtml(text)}</a>`;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -36,10 +36,10 @@ export function MermaidViewer({
|
||||
theme: isDark ? "dark" : "default",
|
||||
flowchart: {
|
||||
useMaxWidth: true,
|
||||
htmlLabels: true,
|
||||
htmlLabels: false,
|
||||
curve: "basis",
|
||||
},
|
||||
securityLevel: "loose",
|
||||
securityLevel: "strict",
|
||||
});
|
||||
|
||||
// Generate unique ID for this render
|
||||
|
||||
Reference in New Issue
Block a user