@unocss/preset-attributify 0.49.1 → 0.49.2
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 +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -117,7 +117,7 @@ const strippedPrefixes = [
|
|
|
117
117
|
":"
|
|
118
118
|
];
|
|
119
119
|
const splitterRE = /[\s'"`;]+/g;
|
|
120
|
-
const elementRE = /<\w(?=.*>)[\w:\.$-]*\s((?:['"`\{].*?['"`\}]|.*?)*?)
|
|
120
|
+
const elementRE = /<\w(?=.*>)[\w:\.$-]*\s((?:['"`\{].*?['"`\}]|.*?)*?)(?:>|\Z)/gs;
|
|
121
121
|
const valuedAttributeRE = /([?]|(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:!%-.]+)=?(?:["]([^"]*)["]|[']([^']*)[']|[{]([^}]*)[}])?/gms;
|
|
122
122
|
const defaultIgnoreAttributes = ["placeholder", "fill", "opacity"];
|
|
123
123
|
const extractorAttributify = (options) => {
|
|
@@ -127,7 +127,7 @@ const extractorAttributify = (options) => {
|
|
|
127
127
|
return {
|
|
128
128
|
name: "attributify",
|
|
129
129
|
extract({ code }) {
|
|
130
|
-
const result = Array.from(code.matchAll(elementRE)).flatMap((match) => Array.from((match[1] || "").matchAll(valuedAttributeRE))).flatMap(([, name, ...contents]) => {
|
|
130
|
+
const result = Array.from(code.matchAll(elementRE)).filter((match) => match[0].endsWith(">")).flatMap((match) => Array.from((match[1] || "").matchAll(valuedAttributeRE))).flatMap(([, name, ...contents]) => {
|
|
131
131
|
const content = contents.filter(Boolean).join("");
|
|
132
132
|
if (ignoreAttributes.includes(name))
|
|
133
133
|
return [];
|
package/dist/index.mjs
CHANGED
|
@@ -113,7 +113,7 @@ const strippedPrefixes = [
|
|
|
113
113
|
":"
|
|
114
114
|
];
|
|
115
115
|
const splitterRE = /[\s'"`;]+/g;
|
|
116
|
-
const elementRE = /<\w(?=.*>)[\w:\.$-]*\s((?:['"`\{].*?['"`\}]|.*?)*?)
|
|
116
|
+
const elementRE = /<\w(?=.*>)[\w:\.$-]*\s((?:['"`\{].*?['"`\}]|.*?)*?)(?:>|\Z)/gs;
|
|
117
117
|
const valuedAttributeRE = /([?]|(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:!%-.]+)=?(?:["]([^"]*)["]|[']([^']*)[']|[{]([^}]*)[}])?/gms;
|
|
118
118
|
const defaultIgnoreAttributes = ["placeholder", "fill", "opacity"];
|
|
119
119
|
const extractorAttributify = (options) => {
|
|
@@ -123,7 +123,7 @@ const extractorAttributify = (options) => {
|
|
|
123
123
|
return {
|
|
124
124
|
name: "attributify",
|
|
125
125
|
extract({ code }) {
|
|
126
|
-
const result = Array.from(code.matchAll(elementRE)).flatMap((match) => Array.from((match[1] || "").matchAll(valuedAttributeRE))).flatMap(([, name, ...contents]) => {
|
|
126
|
+
const result = Array.from(code.matchAll(elementRE)).filter((match) => match[0].endsWith(">")).flatMap((match) => Array.from((match[1] || "").matchAll(valuedAttributeRE))).flatMap(([, name, ...contents]) => {
|
|
127
127
|
const content = contents.filter(Boolean).join("");
|
|
128
128
|
if (ignoreAttributes.includes(name))
|
|
129
129
|
return [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-attributify",
|
|
3
|
-
"version": "0.49.
|
|
3
|
+
"version": "0.49.2",
|
|
4
4
|
"description": "Attributify preset for UnoCSS",
|
|
5
5
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dist"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@unocss/core": "0.49.
|
|
36
|
+
"@unocss/core": "0.49.2"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "unbuild",
|