File tree Expand file tree Collapse file tree
src/editors/containers/TextEditor Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,13 +32,15 @@ const TextEditor = ({
3232 learningContextId,
3333 images,
3434 isLibrary,
35+ validateAssetUrl,
3536} ) => {
3637 const intl = useIntl ( ) ;
3738 const { editorRef, refReady, setEditorRef } = prepareEditorRef ( ) ;
3839 const initialContent = blockValue ? blockValue . data . data : '' ;
3940 const newContent = replaceStaticWithAsset ( {
4041 initialContent,
4142 learningContextId,
43+ validateAssetUrl,
4244 } ) ;
4345 const editorContent = newContent || initialContent ;
4446 let staticRootUrl ;
@@ -106,6 +108,7 @@ TextEditor.defaultProps = {
106108 blockValue : null ,
107109 blockFinished : null ,
108110 returnFunction : null ,
111+ validateAssetUrl : null ,
109112} ;
110113TextEditor . propTypes = {
111114 onClose : PropTypes . func . isRequired ,
@@ -122,6 +125,7 @@ TextEditor.propTypes = {
122125 learningContextId : PropTypes . string , // This should be required but is NULL when the store is in initial state :/
123126 images : PropTypes . shape ( { } ) . isRequired ,
124127 isLibrary : PropTypes . bool . isRequired ,
128+ validateAssetUrl : PropTypes . bool ,
125129} ;
126130
127131export const mapStateToProps = ( state ) => ( {
Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ describe('TextEditor', () => {
7070 test ( 'renders static images with relative paths' , ( ) => {
7171 const updatedProps = {
7272 ...props ,
73+ validateAssetUrl : false ,
7374 blockValue : { data : { data : 'eDiTablE Text with <img src="/static/img.jpg" />' } } ,
7475 } ;
7576 const { container } = render ( < TextEditor { ...updatedProps } /> ) ;
You can’t perform that action at this time.
0 commit comments