babel-plugin-jsx-dom-expressions 0.36.0-beta.7 → 0.36.0
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/index.js +18 -2
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1259,7 +1259,15 @@ function transformAttributes$2(path, results) {
|
|
|
1259
1259
|
} else {
|
|
1260
1260
|
!isSVG && (key = key.toLowerCase());
|
|
1261
1261
|
results.template += ` ${key}`;
|
|
1262
|
-
|
|
1262
|
+
if (!value) return;
|
|
1263
|
+
let text = value.value;
|
|
1264
|
+
if (key === "style" || key === "class") {
|
|
1265
|
+
text = trimWhitespace(text);
|
|
1266
|
+
if (key === "style") {
|
|
1267
|
+
text = text.replace(/; /g, ";").replace(/: /g, ":");
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
results.template += `="${escapeBackticks(escapeHTML(text, true))}"`;
|
|
1263
1271
|
}
|
|
1264
1272
|
}
|
|
1265
1273
|
});
|
|
@@ -2214,7 +2222,15 @@ function transformAttributes$1(path, results, info) {
|
|
|
2214
2222
|
if (t__namespace.isJSXExpressionContainer(value)) value = value.expression;
|
|
2215
2223
|
key = toAttribute(key, isSVG);
|
|
2216
2224
|
appendToTemplate(results.template, ` ${key}`);
|
|
2217
|
-
|
|
2225
|
+
if (!value) return;
|
|
2226
|
+
let text = value.value;
|
|
2227
|
+
if (key === "style" || key === "class") {
|
|
2228
|
+
text = trimWhitespace(text);
|
|
2229
|
+
if (key === "style") {
|
|
2230
|
+
text = text.replace(/; /g, ";").replace(/: /g, ":");
|
|
2231
|
+
}
|
|
2232
|
+
}
|
|
2233
|
+
appendToTemplate(results.template, `="${escapeHTML(text, true)}"`);
|
|
2218
2234
|
}
|
|
2219
2235
|
});
|
|
2220
2236
|
if (!hasChildren && children) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "babel-plugin-jsx-dom-expressions",
|
|
3
3
|
"description": "A JSX to DOM plugin that wraps expressions for fine grained change detection",
|
|
4
|
-
"version": "0.36.0
|
|
4
|
+
"version": "0.36.0",
|
|
5
5
|
"author": "Ryan Carniato",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@babel/core": "^7.20.12"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "05dd73bfadd2bb1b7369764d0d1196f5dc276493"
|
|
35
35
|
}
|