mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 23:10:02 -04:00
fix minor bugs
This commit is contained in:
parent
809e69461e
commit
913b5aeb50
7 changed files with 34 additions and 27 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue