Giter VIP home page Giter VIP logo

Comments (4)

desduvauchelle avatar desduvauchelle commented on August 9, 2024 3

Any update on this?

from draft-js-utils.

sstur avatar sstur commented on August 9, 2024 1

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.

from draft-js-utils.

kevinguard avatar kevinguard commented on August 9, 2024

@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?

from draft-js-utils.

diequinteros avatar diequinteros commented on August 9, 2024

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

from draft-js-utils.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.