@unocss/preset-icons 0.24.3 → 0.24.4

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/dist/index.cjs CHANGED
@@ -39,7 +39,7 @@ async function searchForIcon(collection, id, collections, scale) {
39
39
  height: `${scale}em`,
40
40
  width: `${scale}em`
41
41
  });
42
- return `<svg ${Object.entries(attributes).map((i) => `${i[0]}="${i[1]}"`).join(" ")}>${body}</svg>`;
42
+ return body.includes("xlink:") ? `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" ${Object.entries(attributes).map((i) => `${i[0]}="${i[1]}"`).join(" ")}>${body}</svg>` : `<svg ${Object.entries(attributes).map((i) => `${i[0]}="${i[1]}"`).join(" ")}>${body}</svg>`;
43
43
  }
44
44
  }
45
45
  const preset = (options = {}) => {
package/dist/index.mjs CHANGED
@@ -35,7 +35,7 @@ async function searchForIcon(collection, id, collections, scale) {
35
35
  height: `${scale}em`,
36
36
  width: `${scale}em`
37
37
  });
38
- return `<svg ${Object.entries(attributes).map((i) => `${i[0]}="${i[1]}"`).join(" ")}>${body}</svg>`;
38
+ return body.includes("xlink:") ? `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" ${Object.entries(attributes).map((i) => `${i[0]}="${i[1]}"`).join(" ")}>${body}</svg>` : `<svg ${Object.entries(attributes).map((i) => `${i[0]}="${i[1]}"`).join(" ")}>${body}</svg>`;
39
39
  }
40
40
  }
41
41
  const preset = (options = {}) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/preset-icons",
3
- "version": "0.24.3",
3
+ "version": "0.24.4",
4
4
  "description": "Pure CSS Icons for UnoCSS",
5
5
  "keywords": [
6
6
  "unocss",
@@ -43,7 +43,7 @@
43
43
  ],
44
44
  "dependencies": {
45
45
  "@iconify/utils": "^1.0.23",
46
- "@unocss/core": "0.24.3",
46
+ "@unocss/core": "0.24.4",
47
47
  "local-pkg": "^0.4.1"
48
48
  },
49
49
  "devDependencies": {