Changeset 5623 for trunk/wp-includes/formatting.php
- Timestamp:
- 06/01/2007 02:33:03 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/formatting.php
r5541 r5623 440 440 441 441 $tagstack = array(); $stacksize = 0; $tagqueue = ''; $newtext = ''; 442 $single_tags = array('br', 'hr', 'img', 'input'); //Known single-entity/self-closing tags 443 $nestable_tags = array('blockquote', 'div', 'span'); //Tags that can be immediately nested within themselves 442 444 443 445 # WP bug fix for comments - in case you REALLY meant to type '< !--' … … 490 492 } 491 493 // ElseIf it's a known single-entity tag but it doesn't close itself, do so 492 elseif ( $tag == 'br' || $tag == 'img' || $tag == 'hr' || $tag == 'input') {494 elseif ( in_array($tag, $single_tags) ) { 493 495 $regex[2] .= '/'; 494 496 } else { // Push the tag onto the stack 495 497 // If the top of the stack is the same as the tag we want to push, close previous tag 496 if (($stacksize > 0) && ($tag != 'div') && ($tagstack[$stacksize - 1] == $tag)) {498 if (($stacksize > 0) && !in_array($tag, $nestable_tags) && ($tagstack[$stacksize - 1] == $tag)) { 497 499 $tagqueue = '</' . array_pop ($tagstack) . '>'; 498 500 $stacksize--;
Note: See TracChangeset
for help on using the changeset viewer.