draft-js-utils icon indicating copy to clipboard operation
draft-js-utils copied to clipboard

iframe support?

Open mewben opened this issue 8 years ago • 4 comments

I would like to know if there are any plans to support iframe in the future? Thanks for this btw...

mewben avatar Jun 09 '16 12:06 mewben

@mewben Are you seeing your iframes 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?

kevinguard avatar Aug 21 '16 21:08 kevinguard

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.

sstur avatar Aug 22 '16 02:08 sstur

Any update on this?

desduvauchelle avatar Jan 06 '17 13:01 desduvauchelle

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

diequinteros avatar Jul 17 '18 15:07 diequinteros