Stripping SPANs and class attributes from html?

  • Author
    Posts
  • #11443

    hellonline
    Member

    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.

    #11718

    kingryan
    Member

    @style is removed, too.

    #11737

    martinfitzp
    Member

    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.

    #11794

    hellonline
    Member

    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?)

    #11806

    martinfitzp
    Member

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

    Want to start a club? :)

    #11809

    drmike
    Member

    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

    #11821

    options
    Member

    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.

    #11829

    andy
    Member

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

    #11834

    kingryan
    Member

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

    #11838

    hellonline
    Member

    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.

    #12077

    cwagner
    Member

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

    #12078

    engtech
    Member

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

    #12079

    judyb12
    Member

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

    #12080

    timethief
    Member

    @judyb12
    good spotting … lol… :D

    #12081

    options
    Member

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

    ;-)

The topic ‘Stripping SPANs and class attributes from html?’ is closed to new replies.