mod-build 4.0.94 → 4.0.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/package.json +1 -1
- package/vite.config.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.0.95
|
|
4
|
+
|
|
5
|
+
- Fix lazy-load HTML transform that treated `data-img-class="lazy"` as a `class="lazy"` match and rewrote `data-img-src` to `data-img-data-src`; now only real `class`, `src`, `srcset`, and `href` attributes are affected
|
|
6
|
+
|
|
3
7
|
## 4.0.94
|
|
4
8
|
|
|
5
9
|
- Prefer site config `brandedSiteIdentifiers.publicKey` over the remote branded-site-identifiers lookup
|
package/package.json
CHANGED
package/vite.config.js
CHANGED
|
@@ -107,8 +107,8 @@ export default defineConfig((config) => ({
|
|
|
107
107
|
if (!config.replaceImgSrcWithDataSrc) {
|
|
108
108
|
return html;
|
|
109
109
|
}
|
|
110
|
-
return html.replace(/<[^>]*class\s*=\s*["'][^"']*\b(?:lazy)\b[^"']*["'][^>]*>/gi, tag => {
|
|
111
|
-
return tag.replace(
|
|
110
|
+
return html.replace(/<[^>]*(?<![-\w])class\s*=\s*["'][^"']*\b(?:lazy)\b[^"']*["'][^>]*>/gi, tag => {
|
|
111
|
+
return tag.replace(/(?<![-\w])(src|srcset|href)\s*=\s*["']([^"']+)["']/gi, (match, attr, url) => {
|
|
112
112
|
return `data-${attr}="${url}"`;
|
|
113
113
|
});
|
|
114
114
|
});
|