draft-js-utils
draft-js-utils copied to clipboard
iframe support?
I would like to know if there are any plans to support iframe in the future? Thanks for this btw...
@mewben Are you seeing your iframe
s being reported as like <figure>&nbps</figure>
? I am having problem with all iframe
tags are missing when trying to serialize the draft editor's content for writing to a database. Have you found any workaround for this?
Not specifically. Does Draft support <iframe>
? If it is some custom block renderer that you are using then it should totally be supported by export-html by allowing you to specify how to serialize your custom block to html. So I'm not going to put explicit iframe support in core, but yes I have plans to support it via extension.
Any update on this?
If this is still a issue of some one here, here is my solution to render iframe from the react-draft-wysiwyg editor:
let htmlOptions = { blockRenderers: { 'atomic': (block) => { let key = block.getEntityAt(0); let type = editorState.getCurrentContent().getEntity(key).type; if(type === 'EMBEDDED_LINK') { let url = editorState.getCurrentContent().getEntity(key).getData().src; return '<div><iframe src='+url+' frameborder="0" allow="encrypted-media" allowfullscreen></iframe></div>'; } }, }, };
As @sstur say, is a custom block so u need do a render for it