@@ -17,14 +17,25 @@ import 'tinymce/plugins/image';
1717import 'tinymce/plugins/codesample' ;
1818import '@edx/tinymce-language-selector' ;
1919
20- import contentUiCss from 'tinymce/skins/ui/oxide/content.css' ;
21- import contentCss from 'tinymce/skins/content/default/content.css' ;
20+ /* eslint import/no-webpack-loader-syntax: off */
21+ // eslint-disable-next-line import/no-unresolved
22+ import contentUiCss from '!!raw-loader!tinymce/skins/ui/oxide/content.css' ;
23+ // eslint-disable-next-line import/no-unresolved
24+ import contentCss from '!!raw-loader!tinymce/skins/content/default/content.css' ;
2225
2326export default function TextEditor ( props ) {
2427 const {
2528 onChange, onKeyUp, onInit, disabled, value,
2629 } = props ;
2730
31+ let contentStyle ;
32+ // In the test environment this causes an error so set styles to empty since they aren't needed for testing.
33+ try {
34+ contentStyle = [ contentCss , contentUiCss ] . join ( '\n' ) ;
35+ } catch ( err ) {
36+ contentStyle = '' ;
37+ }
38+
2839 return (
2940 < Editor
3041 initialValue = ""
@@ -38,7 +49,7 @@ export default function TextEditor(props) {
3849 'formatselect fontselect bold italic underline forecolor | codesample bullist numlist alignleft aligncenter alignright alignjustify indent | blockquote link image code ' ,
3950 skin : false ,
4051 content_css : false ,
41- content_style : ` ${ contentUiCss . toString ( ) } \n ${ contentCss . toString ( ) } ` ,
52+ content_style : contentStyle ,
4253 extended_valid_elements : 'span[lang|id] -span' ,
4354 block_unsupported_drop : false ,
4455 image_advtab : true ,
0 commit comments