Need help? Check out our Support site, then


Stripping SPANs and class attributes from html?

  1. I'm trying to get some microformat data working in wordpress.com and it seems like class attributes get stripped from certain elements (at least CITE) and that SPAN tags get completely removed.

    Is that possible or am I going mad? There's no way that wp.com would make it completely impossible to use microformats on the site, right?

    Eran.

  2. @style is removed, too.

  3. Eran, unfortunately that's exactly what happens. It's caused me problems myself (to the point where I replaced text with an image, just to be able to style it - which isn't exactly good practise).

    This is done citing security concerns with executable Javascript - apparently it is possible to do bad things(tm). If you host a WordPress system yourself you're not subject to that restriction, but apart from that you're stuck & make do.

  4. I can understand banning javascript but SPAN tags are not javascript. Neither are the CLASS attributes on my CITE tags (strangely, CLASS attrs are not stripped from DIV tags. Is there some malicious use of the CITE tag that I unaware of?)

  5. I can see what you mean. Now that is strange (almost as strange as someone using the CITE tag..!)

    Want to start a club? :)

  6. For the record, you guys have got me on this one. I can't find anything for CITE or CLASS in searches except for lists of allowed tags.

    Sending in a feedback with a pointer.

    -drmike

  7. frankly, I'm also a little bit puzzled about the proper usage and the point of the cite element as well as the cite attribute, since (known to me) user-agent(s) don't render reference sources visually or designate them somehow at all.

    this markup:

    <cite>Joe</cite> said, <q cite="URI">bla!</q>

    wouldn't have a distinct (for user) presentation (if it's not decorated with a 'style', well 'Joe' would be italicized) and wont tell a user where exactly Joe said that.

    my only uneducated guess it helps somehow data processing of the text marked up by this way, i.e. it's mostly for machines rather than human being.

    BTW, one can see that WP uses a cite element: in the 'Incoming links' on the Dashboard and in the post comments section.

  8. Sorry if the filters are a bit paranoid sometimes. I'll go through them this weekend and see what valid attributes are needlessly blocked.

  9. Andy, thanks for that. Feel free to contact me if you need any more info. You know how to get ahold of me.

  10. CSS is a valid source for presentation info, imo. I still find it useful even if there is no default style associated with CITE tags. I think most WP templates render CITE in italics (as I think is common when using paper as well).

    In this case, I am indeed trying to use more semantic markup so that I'm later able to parse out references from the post. But as I said, with a decent style sheet it is also useful for people reading in a browser.

    Andy: Thanks for taking the time to look at this.

    Eran.

  11. At the moment the id attribute is deleted on saving which essentially disables hcal, which uses id.

  12. @andy: thanks so much for that. It's driven me a bit nuts a few times.

  13. @engtech: You saw this thread was a year old, right?

  14. @judyb12
    good spotting ... lol... :D

  15. 'tis never late to tender thanks
    may devs let in another tag(s)!

    ;-)

Topic Closed

This topic has been closed to new replies.

About this Topic