webpack-easyi18n 0.4.0 → 0.5.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/package.json +1 -1
  2. package/src/index.js +4 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpack-easyi18n",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Go from gettext catalog (.po files) to embeded localization in your Webpack bundles",
5
5
  "engines": {
6
6
  "node": ">=4.3.0 <5.0.0 || >=5.10"
package/src/index.js CHANGED
@@ -118,6 +118,9 @@ class EasyI18nPlugin {
118
118
  }
119
119
  }
120
120
 
121
+ // Escape the translated text BEFORE formatting/splicing
122
+ replacement = EasyI18nPlugin.escapeNuggets(replacement);
123
+
121
124
  // format nuggets
122
125
  var formatItemsMatch = originalText.match(/\|\|\|(.+?)(?:\/\/\/.+?)?\]\]\]/s)
123
126
  if (formatItemsMatch) {
@@ -134,7 +137,7 @@ class EasyI18nPlugin {
134
137
  });
135
138
  }
136
139
 
137
- return EasyI18nPlugin.escapeNuggets(replacement);
140
+ return replacement;
138
141
  });
139
142
 
140
143
  compilation.updateAsset(filename, new SourceMapSource(