Changeset 3273

Show
Ignore:
Timestamp:
12/05/05 17:00:01 (3 years ago)
Author:
ryan
Message:

autop fixes from skeltoac. fixes #2022

Files:

Legend:

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

    r3244 r3273  
    6060    // Space things out a little 
    6161    $pee = preg_replace('!(<(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)!', "\n$1", $pee);  
    62     $pee = preg_replace('!(</(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])>)!', "$1\n", $pee); 
     62    $pee = preg_replace('!(</(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])>)!', "$1\n\n", $pee); 
    6363    $pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines  
    6464    $pee = preg_replace("/\n\n+/", "\n\n", $pee); // take care of duplicates 
    6565    $pee = preg_replace('/\n?(.+?)(?:\n\s*\n|\z)/s', "<p>$1</p>\n", $pee); // make paragraphs, including one at the end  
    6666    $pee = preg_replace('|<p>\s*?</p>|', '', $pee); // under certain strange conditions it could create a P of entirely whitespace  
    67     $pee = preg_replace('!<p>\s*(</?(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|hr|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)\s*</p>!', "$1", $pee); // don't pee all over a tag 
     67   $pee = preg_replace('!<p>\s*(</?(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|hr|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)\s*</p>!', "$1", $pee); // don't pee all over a tag 
    6868    $pee = preg_replace("|<p>(<li.+?)</p>|", "$1", $pee); // problem with nested lists 
    6969    $pee = preg_replace('|<p><blockquote([^>]*)>|i', "<blockquote$1><p>", $pee); 
  • trunk/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js

    r3265 r3273  
    267267 
    268268    // Fix some block element newline issues 
    269     var blocklist = 'blockquote|ul|ol|li|table|thead|tr|th|td|div|h\d|pre'; 
     269    var blocklist = 'blockquote|ul|ol|li|table|thead|tr|th|td|div|h\\d|pre'; 
    270270    content = content.replace(new RegExp('\\s*<(('+blocklist+') ?[^>]*)\\s*>', 'mg'), '\n<$1>'); 
    271271    content = content.replace(new RegExp('\\s*</('+blocklist+')>\\s*', 'mg'), '</$1>\n');