I am trying to insert a simple
img tag into the editor.
jQuery('<img />').attr('src', '/uploads/images/' + res.data.filename); jQuery('.summernote').summernote('insertNode', $image);
I expect to see
<img src="/uploads/images/image.jpg" />
What I am getting is
<p><br><img src="/uploads/images/image.jpg" /></p>
I even append the image object into a paragraph object but then I get
<p><br></p> before and after the node.
Not seeing this behavior obviously written in the plugin source file.
Has anyone applied custom functions to just insert in the plain node?
Try to use 'insertImage' function instead of 'insertNode'.
Here is the docs: insertImage
Understand why it adds the wrapper when I am inserting a node on a new line. It's there as soon as I add a new line that it creates the wrapper aleready.