mnfst-render 0.3.6 → 0.3.7
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/manifest.render.mjs +8 -3
- package/package.json +1 -1
package/manifest.render.mjs
CHANGED
|
@@ -956,14 +956,15 @@ function stripRedundantImgSrcBindings(html) {
|
|
|
956
956
|
* prerender-baked markup (stripped :style, expanded lists, etc.). Tag opens with data-pre-rendered
|
|
957
957
|
* are skipped by manifest.components.processor — required for static prerender output to hydrate correctly.
|
|
958
958
|
*/
|
|
959
|
-
// Prerender inlined Iconify SVG under <i x-icon="iterator.icon">;
|
|
959
|
+
// Prerender inlined Iconify SVG under <i x-icon="iterator.icon">; clear x-icon value so Alpine does not evaluate
|
|
960
|
+
// loop/item expressions while the attribute remains for CSS (e.g. inline layout that keys off [x-icon]).
|
|
960
961
|
function stripResolvedXIconDirectives(html) {
|
|
961
962
|
return html.replace(/<i\b([^>]*)>([\s\S]*?)<\/i>/gi, (full, attrs, inner) => {
|
|
962
963
|
if (!/\sx-icon\s*=/i.test(attrs)) return full;
|
|
963
964
|
if (!/<svg\b/i.test(inner) || !/\bdata-icon\s*=/i.test(inner)) return full;
|
|
964
965
|
const cleaned = attrs
|
|
965
|
-
.replace(/\s+x-icon\s*=\s*"[^"]*"/gi, '')
|
|
966
|
-
.replace(/\s+x-icon\s*=\s*'[^']*'/gi, '')
|
|
966
|
+
.replace(/\s+x-icon\s*=\s*"[^"]*"/gi, ' x-icon=""')
|
|
967
|
+
.replace(/\s+x-icon\s*=\s*'[^']*'/gi, ' x-icon=""')
|
|
967
968
|
.trim();
|
|
968
969
|
const sp = cleaned ? ' ' : '';
|
|
969
970
|
return `<i${sp}${cleaned}>${inner}</i>`;
|
|
@@ -1861,6 +1862,10 @@ async function runPrerender(config) {
|
|
|
1861
1862
|
node.removeAttribute(name);
|
|
1862
1863
|
continue;
|
|
1863
1864
|
}
|
|
1865
|
+
if (name === 'x-icon') {
|
|
1866
|
+
node.setAttribute('x-icon', '');
|
|
1867
|
+
continue;
|
|
1868
|
+
}
|
|
1864
1869
|
let boundAttr = '';
|
|
1865
1870
|
if (name.startsWith(':')) boundAttr = name.slice(1);
|
|
1866
1871
|
else if (name.startsWith('x-bind:')) boundAttr = name.slice('x-bind:'.length);
|