fix minor bugs

This commit is contained in:
Avad3 2024-05-13 22:15:40 -04:00
parent 809e69461e
commit 913b5aeb50
7 changed files with 34 additions and 27 deletions

View file

@ -1,6 +1,6 @@
import { encodeUrl } from "./url"
export function rewriteCss(css: string, origin?: string) {
export function rewriteCss(css: string, origin?: URL) {
css = css.replace(/(?<=url\("?'?)[^"'][\S]*[^"'](?="?'?\);?)/g, (match) => encodeUrl(match, origin));
return "/* intercepted by scramjet 🐳 */" + css;