Make WordPress Core

Changeset 980


Ignore:
Timestamp:
03/21/2004 07:07:55 AM (20 years ago)
Author:
saxmatt
Message:

Fix autop to not mess with pre blocks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions-formatting.php

    r972 r980  
    4545    }
    4646    return $output;
     47}
     48
     49function clean_pre($text) {
     50    $text = stripslashes($text);
     51    $text = str_replace('<br />', '', $text);
     52    return $text;
    4753}
    4854
     
    6571    $pee = preg_replace('!(</?(?:table|thead|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|p|h[1-6])[^>]*>)\s*<br />!', "$1", $pee);
    6672    $pee = preg_replace('!<br />(\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)!', '$1', $pee);
     73    $pee = preg_replace('!(<pre.*?>)(.*?)</pre>!ise', " '$1' .  clean_pre('$2')  . '</pre>' ", $pee);
    6774    $pee = preg_replace('/&([^#])(?![a-z]{1,8};)/', '&#038;$1', $pee);
    6875   
Note: See TracChangeset for help on using the changeset viewer.