| 156 | | // Get the top level parent node |
| 157 | | parent = dom.getParent( node, function( found ) { |
| 158 | | if ( found.parentNode && found.parentNode.nodeName === 'BODY' ) { |
| 159 | | return true; |
| 160 | | } |
| 161 | | |
| 162 | | return false; |
| 163 | | }, editor.getBody() ); |
| 164 | | |
| 165 | | if ( parent ) { |
| 166 | | if ( parent.nodeName === 'P' ) { |
| 167 | | parent.appendChild( dom.create( 'p', null, html ).firstChild ); |
| 168 | | } else { |
| 169 | | dom.insertAfter( dom.create( 'p', null, html ), parent ); |
| 170 | | } |
| 171 | | |
| 172 | | editor.nodeChanged(); |
| 173 | | } |
| | 156 | var el = tinyMCE.activeEditor.dom.create('p', {}, html); |
| | 157 | editor.selection.setNode(el); |