From 8a8602da96f10af7aa6db4236f0ae0b5d1522d0e Mon Sep 17 00:00:00 2001 From: Avior Date: Sun, 4 May 2025 00:17:36 +0200 Subject: [PATCH] fix: url not valid --- .github/scripts/load-cards.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/scripts/load-cards.ts b/.github/scripts/load-cards.ts index ff50125da..693d129f2 100644 --- a/.github/scripts/load-cards.ts +++ b/.github/scripts/load-cards.ts @@ -282,11 +282,11 @@ function generateCommentBody( if (item.status === "added") { commentBody += `
New card: ${fileName}\n\n`; - commentBody += `**File:** [${item.file}](${fileUrl}) \n\n`; + commentBody += `**File:** [${encodeURI(item.file)}](${encodeURI(fileUrl)}) \n\n`; commentBody += "
\n\n"; } else if (item.status === "removed") { commentBody += `
🗑️ Deleted card: ${fileName}\n\n`; - commentBody += `**File:** [${item.file}](${fileUrl}) \n\n`; + commentBody += `**File:** [${encodeURI(item.file)}](${encodeURI(fileUrl)}) \n\n`; commentBody += "
\n\n"; } else if (item.card) { const langInfo = item.usedLanguage ? ` (found using ${item.usedLanguage})` : ""; @@ -307,7 +307,7 @@ function generateCommentBody( commentBody += "\n\n"; } else if (item.error) { commentBody += `
⚠️ Error processing ${fileName}\n\n`; - commentBody += `**File:** [${item.file}](${fileUrl}) \n`; + commentBody += `**File:** [${encodeURI(item.file)}](${encodeURI(fileUrl)}) \n\n`; commentBody += `**Error:** ${item.error}\n\n`; commentBody += "
\n\n"; }