Skip to content

Help to convert to HTML with exportDOM and $generateHTMLFromNodes #3110

Answered by GuyoST
GuyoST asked this question in Q&A
Discussion options

You must be logged in to vote

I finally did it manually, just let me know if there is better way to do it :)

  exportDOM(editor: LexicalEditor): DOMExportOutput {
    const div = document.createElement("div")
    div.style.textAlign = this.__format
    const iframe: HTMLIFrameElement = document.createElement("iframe")
    iframe.setAttribute("width", "560")
    iframe.setAttribute("height", "315")
    iframe.setAttribute("src", `https://www.youtube.com/embed/${this.__id}`)
    iframe.setAttribute("frameBorder", "0")
    iframe.setAttribute("allow", "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture")
    iframe.setAttribute("allowFullScreen", "true")
    iframe.setAttribute("title",

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by GuyoST
Comment options

You must be logged in to vote
1 reply
@WanYingT
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants