Skip to content

Commit

Permalink
🐛 bug: fixed using single quotes (#1) by @neopren
Browse files Browse the repository at this point in the history
  • Loading branch information
neopren authored and kazupon committed Apr 8, 2017
1 parent 64d1393 commit 1911f64
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exports.default = function (content) {
try {
var value = typeof content === 'string' ? JSON.parse(content) : content;
value = JSON.stringify(value).replace(/\u2028/g, '\\u2028').replace(/\u2029/g, '\\u2029');
var code = 'module.exports = function (Component) { Component.options.__i18n = \'' + value + '\' }';
var code = 'module.exports = function (Component) { Component.options.__i18n = \'' + value.replace(/\u0027/g, '\\u0027') + '\' }';
this.callback(null, code);
} catch (err) {
this.emitError(err.message);
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default function (content) {
value = JSON.stringify(value)
.replace(/\u2028/g, '\\u2028')
.replace(/\u2029/g, '\\u2029')
const code = `module.exports = function (Component) { Component.options.__i18n = '${value}' }`
const code = `module.exports = function (Component) { Component.options.__i18n = '${value.replace(/\u0027/g, '\\u0027')}' }`
this.callback(null, code)
} catch (err) {
this.emitError(err.message)
Expand Down

0 comments on commit 1911f64

Please sign in to comment.