Website build error (#1136)

* Fixing model names

* handling arrays of models for agent frontmatter

* Cleaning up some warnings on website build

* adding a workflow to run and perform CI of the website
This commit is contained in:
Aaron Powell
2026-03-23 16:04:46 +11:00
committed by GitHub
parent 165d601f2a
commit 562185066e
6 changed files with 87 additions and 11 deletions
+8 -4
View File
@@ -276,7 +276,11 @@ export function debounce<T extends (...args: unknown[]) => void>(
/**
* Escape HTML to prevent XSS
*/
export function escapeHtml(text: string): string {
export function escapeHtml(text: string | string[]): string {
if (Array.isArray(text)) {
return text.map(escapeHtml).join(", ");
}
return text
.replace(/&/g, "&amp;")
.replace(/</g, "&lt;")
@@ -290,17 +294,17 @@ export function escapeHtml(text: string): string {
* Only allows http/https protocols, returns '#' for invalid URLs
*/
export function sanitizeUrl(url: string | null | undefined): string {
if (!url) return '#';
if (!url) return "#";
try {
const parsed = new URL(url);
// Only allow http and https protocols
if (parsed.protocol === 'http:' || parsed.protocol === 'https:') {
if (parsed.protocol === "http:" || parsed.protocol === "https:") {
return url;
}
} catch {
// Invalid URL
}
return '#';
return "#";
}
/**