File tree 2 files changed +2
-2
lines changed
2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ exports.default = function (content) {
9
9
try {
10
10
var value = typeof content === 'string' ? JSON . parse ( content ) : content ;
11
11
value = JSON . stringify ( value ) . replace ( / \u2028 / g, '\\u2028' ) . replace ( / \u2029 / g, '\\u2029' ) ;
12
- var code = 'module.exports = function (Component) { Component.options.__i18n = \'' + value + '\' }' ;
12
+ var code = 'module.exports = function (Component) { Component.options.__i18n = \'' + value . replace ( / \u0027 / g , '\\u0027' ) + '\' }' ;
13
13
this . callback ( null , code ) ;
14
14
} catch ( err ) {
15
15
this . emitError ( err . message ) ;
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ export default function (content) {
7
7
value = JSON . stringify ( value )
8
8
. replace ( / \u2028 / g, '\\u2028' )
9
9
. replace ( / \u2029 / g, '\\u2029' )
10
- const code = `module.exports = function (Component) { Component.options.__i18n = '${ value } ' }`
10
+ const code = `module.exports = function (Component) { Component.options.__i18n = '${ value . replace ( / \u0027 / g , '\\u0027' ) } ' }`
11
11
this . callback ( null , code )
12
12
} catch ( err ) {
13
13
this . emitError ( err . message )
You can’t perform that action at this time.
0 commit comments