Note that there are some explanatory texts on larger screens.

plurals
  1. POTinymce images auto-wrapped in <p> tag. CSS ways around or text editor hacks
    primarykey
    data
    text
    <p>Hiya,<br> I have run into this problem many times now using drupal or wordpress where my tinymce config files are a bit too cleverly abstracted. </p> <p>The problem is that tinymce auto-wraps my <code>&lt;img&gt;</code> tags in <code>&lt;p&gt;</code> tags. If there is a way around this in either Wordpress or Drupal, that would be awesome. </p> <p>My problem exists when I want to do something like this</p> <pre><code>&lt;style&gt; img { float: left; } p { float: right; margin-right: 20px; width: 400px; } &lt;/style&gt; </code></pre> <p>and I want my code to look like this</p> <pre><code>&lt;img src="some_png.png" /&gt; &lt;p&gt; Imagine a lot of lipsum text.&lt;/p&gt; </code></pre> <p>but tinymce does this</p> <pre><code>&lt;p&gt;&lt;img src="crap_im_wrapped_in_a_paragraph.png" /&gt;&lt;/p&gt; &lt;p&gt; Imagine a lot of lipsum text.&lt;/p&gt; </code></pre> <p>I'm trying to float an image to the left of a paragraph with a set width, without having width restraints on the image itself.<br> in this case the image's parent then gets a width and a float right. That is <strong>not</strong> what I want. </p> <p>It is very possible that there is an easy clever fix for this but I still have not found one. I would prefer not hacking my config files if I don't have to.</p> <p>1 caveat...<br> The only reason this problem exists is because I want clients to be able to easily do their own editing so <strong>I won't just have them wrap the image in a <code>&lt;div&gt;</code> instead of a <code>&lt;p&gt;</code>. That seems to me unintuitive for my clients who are the actual users of the wysiwyg</strong></p> <p><strong>Previous Solution</strong><br> I have been using a regex to remove the paragraph tags but it is always somehow problematic. I end up adding more images somewhere else then i have to keep tuning my regex to ignore them. 502 errors abound!</p> <p>my question(s) is(are)<br> <strong>What can I to in my CSS to make the image wrapped in the paragraph do what I want it to do?</strong><br> and if i can't<br> <strong>What drupal or wordpress specific can I do to make that paragraph disappear?</strong></p> <p>-- <strong>Edit</strong> -- the solution needs to be compatible with IE7+ and modern browsers. :P </p> <p>Thanks!<br> aaron</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload