Pasting HTML copied from the browser (try CMD-A, CMD-C in gmail) into a contenteditable PRE in Firefox (34.0) puts the new elements after the PRE, not inside (inspect to verify).
<pre contenteditable="true" style="height:200px; width:200px; border:1px solid red"/>
See this jsfiddle: http://jsfiddle.net/w5cs9pzo/1/
I can only reproduce this problem with PREs - DIVs are fine.
Any workaround would be appreciated.
` elements in the HTML (versus the well-formed `
`), specifically `
`. I worked around this by canceling the default paste and using `document.execCommand("insertHTML", false,
` could only cause a problem if you are using XHTML. Are you? – Tim Down Mar 09 '15 at 12:28