WordPress.org

Make WordPress Core

Ticket #6016: FixExtendedWhitespace.diff

File FixExtendedWhitespace.diff, 1.8 KB (added by redsweater, 10 years ago)

Trim the whitespace from description and more/extended.

  • xmlrpc.php

     
    12961296                }
    12971297
    12981298                if ($post_more) {
    1299                         $post_content = $post_content . "\n<!--more-->\n" . $post_more;
     1299                        // In order to match the behavior of the wp-admin editor, we have to trim
     1300                        // whitespace from the post_content and post_more. Otherwise any newline
     1301                        // that a client might reasonably add to finish the section gets literally
     1302                        // interpreted here.
     1303                        //
     1304                        // While there is some value in the idea of literal interpretation, the current
     1305                        // behavior of the more tag is such that it sort of expects to follow this format
     1306                        // of "stripped content separated by a more tag on its own line." We'll just comply
     1307                        // with that to ensure compatible behavior.
     1308                        $post_content = trim($post_content) . "\n<!--more-->\n" . trim($post_more);
    13001309                }
    13011310
    13021311                $to_ping = $content_struct['mt_tb_ping_urls'];
     
    15651574                }
    15661575
    15671576                if ($post_more) {
    1568                         $post_content = $post_content . "\n<!--more-->\n" . $post_more;
     1577                        // In order to match the behavior of the wp-admin editor, we have to trim
     1578                        // whitespace from the post_content and post_more. Otherwise any newline
     1579                        // that a client might reasonably add to finish the section gets literally
     1580                        // interpreted here.
     1581                        //
     1582                        // While there is some value in the idea of literal interpretation, the current
     1583                        // behavior of the more tag is such that it sort of expects to follow this format
     1584                        // of "stripped content separated by a more tag on its own line." We'll just comply
     1585                        // with that to ensure compatible behavior.
     1586                        $post_content = trim($post_content) . "\n<!--more-->\n" . trim($post_more);
    15691587                }
    15701588
    15711589                $to_ping = $content_struct['mt_tb_ping_urls'];