title: In Draft-JS, how do i insert an html iframe into my contentState?
body: <p>I am using React and react-draftjs-wysiwyg / Draft JS to build a text editor / CMS.</p>
  
  <p>Right now i want to add functionality where:-</p>
  
  <ol>
  <li><p>user goes into separate <code>&lt;Input /&gt;</code> on the page.</p></li>
  <li><p>React detects what link it is (YouTube, SoundCloud, Vimeo)</p></li>
  <li><p>My function creates an iframe for it</p></li>
  <li><p>Draft inserts it at whatever the current cursor position is.</p></li>
  </ol>
  
  <p>All of that is done except number 4. I was thinking, get the cursor position and push the iframe HTML el into that part of the contentState? But that's mixing two different data types. iframe is in html, contentState is draft-js' object.</p>
  
  <p>Another idea was: get the text from the anchorKey, convert the existing contentState to HTML, locate the text, <em>then</em> find the next blank space after it (via regex perhaps) and append the iframe to that. Then convert the whole thing back to contentState and pass it to EditorState prop? Seems very bitty though...</p>
  
  <p>At the moment my function looks like this:</p>
  
  <pre><code>
  // react methods...
  
  insertIFrameAtCursorPoint = (iframeHTMLelement) =&gt; {
      const { editorState } = this.state;
      const SelectionState = editorState.getSelection();
      let currentCursorPosition = SelectionState.getAnchorKey();
  
      let currentContent = editorState.getCurrentContent();
      let currentContentBlock = currentContent.getBlockForKey(currentCursorPosition);
  
      // change iframeHTMLelement into a block?
      // add block back to currentContent?
      // 
  
  }
  
  // render() {
         return (...
     }
  </code></pre>
  
  <p>Help?</p>