diff --git a/deno.json b/deno.json index a56b51a..cbc2698 100644 --- a/deno.json +++ b/deno.json @@ -1,6 +1,6 @@ { "name": "@vrugtehagel/eleventy-asset-hash", - "version": "0.1.4", + "version": "0.1.5", "exports": "./mod.ts", "publish": { "include": ["src/**", "mod.ts", "README.md"] diff --git a/src/detect-assets.ts b/src/detect-assets.ts index ef70e0b..d670e95 100644 --- a/src/detect-assets.ts +++ b/src/detect-assets.ts @@ -1,12 +1,12 @@ -/** Valid URL path characters are [!$%(-;=@-[\]_a-z~]. +/** Valid URL path characters are [!$%(-;@-[\]_a-z~]. * The entire regex matches assets in a string of content. * This does not match URLs including a domain, by design. */ const regex = new RegExp( - "(?<=[^!$%(-;=@-[\\]_a-z~])" + // must be preceded by non-URL character + "(?<=[^!$%(-;@-[\\]_a-z~])" + // must be preceded by non-URL character "\\.{0,2}/" + // then zero to two periods and a slash - "[!$%(-;=@-[\\]_a-z~]*" + // any number of URL characters + "[!$%(-;@-[\\]_a-z~]*" + // any number of URL characters "\\.\\w+" + // the file extension, minimum one character long - "(?=[^!$%(-;=@-[\\]_a-z~])", // followed by a non-URL character + "(?=[^!$%(-;@-[\\]_a-z~])", // followed by a non-URL character "g", // This is not part of the regex, it's just a flag );