This patch extends the list of HTML tags that are allowed by the HTML filter by default. This is a feature that was requested in this thread:

http://drupal.org/node/30364#new

The list of tags allowed by this patch includes:

<a> <em> <strong> <cite> <blockquote> <pre> <code> <ul> <ol> <li> <dl> <dt> <dd> <h2> <h3> <h4> <h5> <h6> <ins> <del>

I didn't include <h1> because that is used by the title more often than not. Discussion on the list of tags is welcome, but I agree with the poster that mentioned this that there could be more without any danger to site or theme.

CommentFileSizeAuthor
filter_patch.txt994 bytesrobertdouglass

Comments

sepeck’s picture

There are a lot of themes that use h2 for the node title. I think we should exclude that from the list of defaults. Otherwise, I don't see a problem.

dries’s picture

Status: Reviewed & tested by the community » Closed (won't fix)

Not going to commit this patch. It should be easy enough to change this as an administrator.

robertdouglass’s picture

I won't argue at this point, though it is a lot easier to delete unwanted tags than to type in desired tags. Seems like a missed opportunity at a small usability gain.

neuraxon77’s picture

Thanks for trying robert. :)

I'd point out that all of these additions, with the exception of <del> are permitted on drupal.org.
It would be just as easy for administrators to revoke them should any problems arise while gaining a little usability. I do however understand Dries concern in that existing content using any tags that become revoked will not appear for that content. Personally, likely revoked tags would really only be sepeck's objection to h2 and possibly the other headers.

Dave Cohen’s picture

On my own sites I've allowed <p> and <div>. Is there some reason these should not be allowed?

Forgive me if this is not the appropriate place for this question.

Jaza’s picture

I have allowed these additional tags on my site, and I think that they should be added to this patch:

<abbr> <sub> <sup>

I also allow p and br tags, but I don't think these should be in the default list, because of the popularity of the line break converter filter in core. I also don't think that div or span tags should be allowed by default, as they give the average user too much control over the style and layout of the content. And as for h2 tags, I agree with sepeck that this would conflict with too many themes - users that want this can add it manually.

This is a very useful patch, IMO, and I for one would like to see it committed. The current default list is too restrictive, and I suspect that many site admins don't bother to add to it, much to the annoyance of the site's users.