File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 4
4
"type" : " git" ,
5
5
"url" : " https://github.com/wix/react-native-zss-rich-text-editor.git"
6
6
},
7
- "version" : " 1.2.0 " ,
7
+ "version" : " 1.2.1 " ,
8
8
"description" : " React Native Wrapper for ZSSRichTextEditor" ,
9
9
"main" : " index.js" ,
10
10
"license" : " SEE LICENSE IN LICENSE" ,
Original file line number Diff line number Diff line change @@ -373,6 +373,7 @@ export default class RichTextEditor extends Component {
373
373
} }
374
374
onMessage = { message => this . onMessage ( message ) }
375
375
source = { pageSource }
376
+ originWhitelist = { [ '*' ] }
376
377
onLoad = { ( ) => this . init ( ) }
377
378
/>
378
379
{ this . _renderLinkModal ( ) }
@@ -394,8 +395,9 @@ export default class RichTextEditor extends Component {
394
395
} ;
395
396
396
397
_sendAction ( action , data ) {
397
- let jsToBeExecutedOnPage = MessageConverter ( { type : action , data } ) ;
398
- this . webview . injectJavaScript ( jsToBeExecutedOnPage + ';true;' ) ;
398
+ const escapedData = typeof data === 'string' ? this . escapeJSONString ( data ) : data ;
399
+ const jsToBeExecutedOnPage = MessageConverter ( { type : action , data : escapedData } ) ;
400
+ this . webview . injectJavaScript ( `${ jsToBeExecutedOnPage } ;true;` ) ;
399
401
}
400
402
401
403
//-------------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments