Text of the following form:

This is foo style="something" bar.

gets filtered into:

This is foo

It seems to happen in most modules (comment, book, ... but not in blog).

Comments

ax’s picture

Version: x.y.z »

from the admin-docs(pages) (admin > settings and filters > content filters):

Allowed HTML tags:

If enabled, optionally specify tags which should not be stripped. 'STYLE' attributes, 'ON' attributes and unclosed tags are always stripped.

Anonymous’s picture

Is there a reason this is hardcoded? I could see some use for style at least on a site where the people with post access are trusted. Wouldn't this be better as an option?

Anonymous’s picture

Assigned: Unassigned » Kjartan

No feedback so I will try out a few things and see what I can work out.

Steven’s picture

Style is a very dangerous attribute, so either we filter it out completely, or we filter the CSS attributes and allow only certain ones. An example:

<p style='position: absolute; top: 0px; left; 0px; width: 10000; height: 10000; background-color: white; z-index: 1000;'></p>

Works with almost every block-element in HTML (B, U, I, ...) in IE6, not sure about other browsers.

The fact that even style="" outside of a tag gets filtered is a nasty bug though, e.g; when discussing CSS.

Anonymous’s picture

Fixed.

Anonymous’s picture

Priority: Major » Normal