Hi Markus,

Thanks for your answer. Well, actually, I'm running into a similar issue with the class attribute.

<img class="caption" ...> 

gets stripped although I have set my img[*] in the list of tags and attributes.
all the other attributes remain, but not the class="caption".

Any reason why this wouldn't be working?

Comments

gafir777’s picture

here is what i get in tiny mce:

<img class="caption" style="border: 0pt none; margin: 5px; vertical-align: bottom;" src="/sites/default/files/atlanticthumb.jpg" border="0" alt="signs books at Atlantic Books" title="signs books at Atlantic Books" width="250" height="375" />

and here is the output:

<img style="border: 0pt none; margin: 5px; vertical-align: bottom;" src="/sites/default/files/atlanticthumb.jpg" border="0" alt="signs books at Atlantic Books" title="signs books at Atlantic Books" width="250" height="375" />

the class="caption" has been removed.

I actually tried to use the FULL HTML input format and turn off all other filters than Wysiwyg filter and it works, however, if i do the same for my custom input filter, the class is stripped. So I don't think it's related to the other input filters in the custom input format. Very weird.
Again, in the list of tags allowed, I have img[*]
I have also tried img[*|class<caption] and it has the same effect, which is none...
:(

gafir777’s picture

Here is the list of allowed tags as described below tinymce:

Allowed HTML tags: <a> <blockquote> <br> <cite> <code> <dd> <div> <dl> <dt> <em> <h1> <h2> <h3> <h4> <img> <li> <ol> <p> <span> <strong> <table> <tbody> <td> <th> <tr> <ul>
Allowed Style properties: border, border-bottom, border-bottom-color, border-bottom-style, border-bottom-width, border-color, border-left, border-left-color, border-left-style, border-left-width, border-right, border-right-color, border-right-style, border-right-width, border-style, border-top, border-top-color, border-top-style, border-top-width, border-width, clear, display, float, height, margin, margin-bottom, margin-left, margin-right, margin-top, padding, padding-bottom, padding-left, padding-right, padding-top, position, text-align, text-indent, visibility, width

and in my wysiwyg filter settings:

a[!href|target<_blank|title],
div[align<center?justify?left?right],
p[align<center?justify?left?right|style],
br,em,strong,cite,code,blockquote,ul,ol,li,dl,dt,dd,
img[*|class<caption],
table[*],
tr[*],
td[*],
th[*],
tbody[*],
h1[*],
h2[*],
h3[*],
h4[*],
span[*]
gafir777’s picture

All other filter than wysiwyg filter is unchecked:

Choose the filters that will be used in this filter format.

HTML corrector >> unchecked

HTML filter >> unchecked

Line break converter >> unchecked

URL filter >> unchecked

WYSIWYG Filter >> checked

gafir777’s picture

something causes the class="caption" to be stripped, but I can't see what. Thank you very much for your help, I've tried to bring as many element as I could... let me know if you need something else.

markus_petrux’s picture

In the configuration screen of the filter, the description of the field "HTML elements and attributes" has a section labelled "Additional notes". The second point reads:

If you allow usage of the attributes "id", "class" and/or "style", then you should also select which style properties are allowed and/or specify explicit matching rules for them using the "Advanced rules" section below.

In the "Advanced rules" section you should enter somthing in the field "Rules for Class elements".

The reason for this additional option being required is that users could use any CSS class that you have defined in your site, and they could break the layout. So you should probably better create a few CSS classes they can use safely.

markus_petrux’s picture

Status: Active » Fixed
markus_petrux’s picture

Category: bug » support
Priority: Critical » Normal

OMG! Sorry for all separated replies. :(

gafir777’s picture

Hi Markus,

Thanks for your help! Not sure to understand what you mean with this, but i'll try to figure it out. Concretely, I don't see what I can do to fix it.

gafir777’s picture

do you have any example I could use for Rules for Class elements? Is there a documentation page for this? I'm not very familiar with it.

markus_petrux’s picture

There's a description for each field on the filter settings panel, also there are a few examples on each one. Maybe what I wrote is not easy to follow. :-|

markus_petrux’s picture

Status: Fixed » Closed (fixed)