Fix that blob urls persist on the shared anchor element and can't be later modified (#1467)

* Fix that blob urls persist on the shared anchor element and can't be later modified

* Create nervous-kiwis-nail.md
This commit is contained in:
Eoghan Murray
2024-05-03 12:20:20 +01:00
committed by GitHub
parent 5e7943dbae
commit e96f668c86
2 changed files with 8 additions and 0 deletions

View File

@@ -218,6 +218,8 @@ function getHref(doc: Document, customHref?: string) {
}
if (!customHref) {
customHref = '';
} else if (customHref.startsWith('blob:') || customHref.startsWith('data:')) {
return customHref;
}
// note: using `new URL` is slower. See #1434 or https://jsbench.me/uqlud17rxo/1
a.setAttribute('href', customHref);