I need to configure the filter so that it respects all attributes of an image added via IMCE. I've tried everything I can think of but I still cannot get the image to display correctly.
With filtering turned off, the html is:
<img alt="Modified Endowment Contract" src="http://xxx.xxx.xxx.xxx/sites/default/files/internal-revenue-code.jpg" style="border-width: 0px; border-style: solid; width: 240px; height: 175px; float: right;" />
With filtering turned off with my current settings, the html is:
<img alt="Modified Endowment Contract" src="http://xxx.xxx.xxx.xxx/sites/default/files/internal-revenue-code.jpg" />
So the style is being stripped out completely.
In the settings, I have the following HTML elements and attributes:
a[!href|target<_blank|title],
div[align<center?justify?left?right],
p[align<center?justify?left?right],
img[!src|alt|title|style|width|height|class|typeof],
br,span,em,strong,cite,code,blockquote,ul,ol,li,dl,dt,dd
I have every checkbox checked just to make sure. For Rules for Class Names I'm just using "userclass*". Nothing for Rules for Element IDs. And for Rules for URLs used within inline styles I'm using: /*,/~site/*,http://xxx.xxx.xxx.xxx/*.
What am I doing wrong?
Thanks
Comments
Comment #1
Lloyd CreditAttribution: Lloyd commentedanybody?
Comment #2
Kristen PolI'm getting this same problem with TinyMCE+wysiwyg filter. Turn off wysiwyg filter and everything is aligned properly. Turn on wysiwyg filter and styles are stripped out.
I'm using Media module (2.x branch). I thought maybe it was due to that. Are you using the Media module for image insertion?
My filtering is set up with:
When using the default filters, then I couldn't even see the images within the wysiwyg. When changing the filters to above, then I could see them in the wysiwyg but then the image styles are removed so the alignment is not as desired when viewing.
Comment #3
populist CreditAttribution: populist commentedIn order to get image alignment working correctly, you not only need to set up the filtering rules as you did above (i.e. allow the img tag with the style property) but ALSO check the "float" option in the allowed styles further down on the configuration page.
Comment #4
Kristen PolThanks @populist. That is the solution provided here too:
#1602280: Images added using Media Browser in TinyMCE do not keep alignment due to WYSIWYG Filter
so I'll try it!
Comment #5
populist CreditAttribution: populist commented