Skip to content

Commit 9929e0c

Browse files
authored
fix: use parsed url
1 parent 6dc10a8 commit 9929e0c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

app/components/MarkdownText.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function parseMarkdown(text: string): string {
4040
try {
4141
const parsed = new URL(decodedUrl)
4242
if (['https:', 'mailto:'].includes(parsed.protocol)) {
43-
const safeUrl = decodedUrl.replace(/"/g, '"')
43+
const safeUrl = parsed.toString().replace(/"/g, '"')
4444
return `<a href="${safeUrl}" rel="nofollow noreferrer noopener" target="_blank">${text}</a>`
4545
}
4646
} catch {}

0 commit comments

Comments
 (0)