<div>blah<!--more-->blah</div> breaks themes, validation
|Reported by:||skeltoac||Owned by:||ryan|
TinyMCE produces code like that sometimes. If it were a P tag it would only break validation; because we don't nest P tags the browser closes the P when it reaches the next /DIV. However, because themes generally give one DIV per post, nesting goes all awry when a /DIV is missing from within a post. It causes all following posts to nest and, in most themes, indent. The effect is cumulative with multiple split posts, as often occurs on home pages and in archives.
We should fix any nodes broken by the "more" split in get_the_content().
The attached patch makes it possible to force balanceTags to ignore the option so we can use it to fix the split post in get_the_content(). I profiled this in the ZDE and found that balanceTags took a negligible .14-.49ms per split post. It is not run on posts that are not split.
The patch also includes an optimization in get_the_content(), replacing a preg_match() with a strpos().
Change History (7)
- Cc enochfung added
- Component changed from Optimization to Shortcodes
- Resolution fixed deleted
- Status changed from closed to reopened
- Version changed from 2.0 to 2.9.1