@lingui/macro 3.13.3 → 3.14.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.
Files changed (2) hide show
  1. package/macroJsx.js +2 -5
  2. package/package.json +2 -2
package/macroJsx.js CHANGED
@@ -67,11 +67,8 @@ var MacroJSX = /*#__PURE__*/function () {
67
67
  (0, _defineProperty2.default)(this, "expressionIndex", void 0);
68
68
  (0, _defineProperty2.default)(this, "elementIndex", void 0);
69
69
  (0, _defineProperty2.default)(this, "safeJsxAttribute", function (name, value) {
70
- // Quoted JSX attributes use XML-style escapes instead of JavaScript-style escapes.
71
- // This means that <Trans id="Say \"hi\"!" /> is invalid, but <Trans id={"Say \"hi\"!"} /> is valid.
72
- // We could consider removing this condition and always wrap in a jsxExpressionContainer.
73
- var attributeValue = value.includes('"') ? _this.types.jsxExpressionContainer(_this.types.stringLiteral(value)) : _this.types.stringLiteral(value);
74
- return _this.types.jsxAttribute(_this.types.jsxIdentifier(name), attributeValue);
70
+ // This handles quoted JSX attributes and html entities.
71
+ return _this.types.jsxAttribute(_this.types.jsxIdentifier(name), _this.types.jsxExpressionContainer(_this.types.stringLiteral(value)));
75
72
  });
76
73
  (0, _defineProperty2.default)(this, "replacePath", function (path) {
77
74
  var tokens = _this.tokenizeNode(path.node);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingui/macro",
3
- "version": "3.13.3",
3
+ "version": "3.14.0",
4
4
  "description": "Macro for generating messages in ICU MessageFormat syntax",
5
5
  "main": "index.js",
6
6
  "author": {
@@ -30,7 +30,7 @@
30
30
  ],
31
31
  "dependencies": {
32
32
  "@babel/runtime": "^7.11.2",
33
- "@lingui/conf": "^3.13.3",
33
+ "@lingui/conf": "^3.14.0",
34
34
  "ramda": "^0.27.1"
35
35
  },
36
36
  "peerDependencies": {