This project is read-only.

Tinymce wraps img in p

Topics: Customizing Orchard
May 9, 2014 at 7:23 PM
I know this isn't a real Orchard question but maybe someone on the forum has experienced the same issue...

The tinymce editor in Orchard wraps everything in a <p> tag. Including images.

If i set forced_root_block: false, in TinyMce.Init it doesn't wrap it anymore but then normal text isn't wrapped anymore...

does anyone know how to set this just for images?


May 11, 2014 at 9:25 AM

Where should I add this string? The problem is that everything in tinymce is wrapped in a <p> tag so I can't float my images. I don't want the editors of the site to go into the html code of tinymce (i even disabled it)
May 11, 2014 at 5:25 PM

I found this on a blog:

If you first set the forced_root_blog to false and then use this code:
        ed.onNodeChange.add(function(editor, cm, e, c, o) {
             var editorContent = ed.getContent();
            if (editorContent==="") {
                // We set content as a <p> containing a placeholder, then we delete the placeholder to place the caret
                ed.setContent('<p><span id="__CaretPlacholder">Placeholder</span></p>');
this just wraps the whole block in one <p> so that doesn't help me either to float my image and the text next to it :)

If anyone knows how to solve this pesky problem please step forward! :)