webpack-easyi18n 0.3.7 → 0.3.8
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/package.json +1 -1
- package/src/index.js +7 -1
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -15,6 +15,12 @@ class EasyI18nPlugin {
|
|
|
15
15
|
includeUrls: null,
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
+
static escapeSpeechMarks = (string) => {
|
|
19
|
+
return string
|
|
20
|
+
.replace(/'/g, '\\\'')
|
|
21
|
+
.replace(/"/g, '\\"');
|
|
22
|
+
}
|
|
23
|
+
|
|
18
24
|
constructor(locale, options = {}) {
|
|
19
25
|
this.locale = locale;
|
|
20
26
|
this.options = {
|
|
@@ -127,7 +133,7 @@ class EasyI18nPlugin {
|
|
|
127
133
|
});
|
|
128
134
|
}
|
|
129
135
|
|
|
130
|
-
return replacement;
|
|
136
|
+
return EasyI18nPlugin.escapeSpeechMarks(replacement);
|
|
131
137
|
});
|
|
132
138
|
|
|
133
139
|
compilation.updateAsset(filename, new SourceMapSource(
|