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?
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.
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?
Very top of the page: OPTIONS PAGE
Even has a screen shot.
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!
- The topic ‘SPAN tags break wpautop if priority is altered’ is closed to new replies.