babel-plugin-jsx-dom-expressions 0.35.17 → 0.35.18

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.
Files changed (2) hide show
  1. package/index.js +5 -4
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  var SyntaxJSX = require('@babel/plugin-syntax-jsx');
4
4
  var t = require('@babel/types');
5
- var htmlEntities = require('html-entities');
6
5
  var helperModuleImports = require('@babel/helper-module-imports');
6
+ var htmlEntities = require('html-entities');
7
7
 
8
8
  function _interopNamespaceDefault(e) {
9
9
  var n = Object.create(null);
@@ -1181,7 +1181,7 @@ function transformAttributes$2(path, results) {
1181
1181
  } else {
1182
1182
  !isSVG && (key = key.toLowerCase());
1183
1183
  results.template += ` ${key}`;
1184
- results.template += value ? `="${escapeBackticks(escapeHTML(htmlEntities.decode(value.value), true))}"` : "";
1184
+ results.template += value ? `="${escapeBackticks(escapeHTML(value.value, true))}"` : "";
1185
1185
  }
1186
1186
  }
1187
1187
  });
@@ -2126,7 +2126,7 @@ function transformAttributes$1(path, results, info) {
2126
2126
  if (t__namespace.isJSXExpressionContainer(value)) value = value.expression;
2127
2127
  key = toAttribute(key, isSVG);
2128
2128
  appendToTemplate(results.template, ` ${key}`);
2129
- appendToTemplate(results.template, value ? `="${escapeHTML(htmlEntities.decode(value.value), true)}"` : "");
2129
+ appendToTemplate(results.template, value ? `="${escapeHTML(value.value, true)}"` : "");
2130
2130
  }
2131
2131
  });
2132
2132
  if (!hasChildren && children) {
@@ -2890,7 +2890,8 @@ function transformComponent(path) {
2890
2890
  : node.argument
2891
2891
  );
2892
2892
  } else {
2893
- const value = node.value || t__namespace.booleanLiteral(true),
2893
+ // handle weird babel bug around HTML entities
2894
+ const value = (t__namespace.isStringLiteral(node.value) ? t__namespace.stringLiteral(node.value.value): node.value) || t__namespace.booleanLiteral(true),
2894
2895
  id = convertJSXIdentifier(node.name),
2895
2896
  key = id.name;
2896
2897
  if (hasChildren && key === "children") return;
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.35.17",
4
+ "version": "0.35.18",
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": "fbbe545542d31315282b78accbba552b686085b5"
34
+ "gitHead": "5e21b8cb58fbccc1f635bfdfd8904094e46edfea"
35
35
  }