WordPress.org

Ready to get started?Download WordPress

Forums

Collapse-O-Matic
[resolved] SPAN tags break wpautop if priority is altered (6 posts)

  1. pha3z
    Member
    Posted 1 year ago #

    Is there some specific reason why collapse-o-matic outputs SPAN tags instead of DIVs? I'm pretty sure span tags are not meant to be block-level elements. They're supposed to appear inside of paragraphs. Because of this, wpautop will attempt to wrap them if you run it after the shortcode.

    Default WP behavior is for wpautop to run before shortcodes, however the default behavior creates known bugs with nested shortcodes and perhaps other shortcode situations. As a result a lot of people move wpautop to run after their shortcodes. They change priority to 99. This results in <span> tags getting wrapped.

    Wouldn't it be better to just use DIVs to improve reliability?

    http://wordpress.org/extend/plugins/jquery-collapse-o-matic/

  2. Baden
    Member
    Plugin Author

    Posted 1 year ago #

    No specific reason, other than the initial use of the plugin used span tags. You make a good point, and we will consider changing the default tag. In the mean time, span tags can be replaced by div tags by:

    1. adding the tag="div" attribute for single elements
    2. setting page options default tag attributet to div

    Thank you for the informed and well thought out post.

  3. pha3z
    Member
    Posted 1 year ago #

    You're welcome.

    1. Thanks for the information about tag="div". I didn't realize I could change that. I've got like 30+ expandable elements, but I can change them all with a search and replace. It'll work!

    2. I'm not sure what you're referring to by page options default tag. Is that a collapse-o-matic feature?

  4. Baden
    Member
    Plugin Author

    Posted 1 year ago #

    http://plugins.twinpictures.de/plugins/collapse-o-matic/documentation/
    Very top of the page: OPTIONS PAGE
    Even has a screen shot.

  5. pha3z
    Member
    Posted 1 year ago #

    I never even noticed this. Fail @ me.

    I still think it'd be worthwhile to change the spans to divs as the default though. Anything better out of the box is almost always worthwhile.

    Thanks for the link to the page. I hadn't been to your site!

  6. Baden
    Member
    Plugin Author

    Posted 1 year ago #

    Yup, we are including this change in the next update.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic