[wp-trac] [WordPress Trac] #4556: Fancy quotes broken inside parentheses

WordPress Trac wp-trac at lists.automattic.com
Thu Jun 28 13:41:01 GMT 2007


#4556: Fancy quotes broken inside parentheses
-------------------------+--------------------------------------------------
 Reporter:  bglickstein  |       Owner:  anonymous
     Type:  defect       |      Status:  new      
 Priority:  normal       |   Milestone:           
Component:  General      |     Version:           
 Severity:  minor        |    Keywords:           
-------------------------+--------------------------------------------------
 If I put text in plain quotes inside of parentheses ("like this"),
 Wordpress mistranslates the quotes into curly quotes.  I have a simple
 patch against wp-includes/formatting.php (tag 2.2.1, revision 5735) that
 should fix this.  It makes open-parens (and open-brackets) "transparent"
 to left curly quotes, and close-parens (and close-brackets) "transparent"
 to right curly quotes.

 Cheers,[[BR]]
 - Bob

 {{{
 Index: formatting.php
 ===================================================================
 --- formatting.php      (revision 5772)
 +++ formatting.php      (working copy)
 @@ -20,8 +20,8 @@
         $static_characters = array_merge(array('---', ' -- ', '--',
 'xn–', '...', '``', '\'s', '\'\'', ' (tm)'), $cockney);
         $static_replacements = array_merge(array('—', ' — ',
 '–', 'xn--', '…', '“', '’s', '”', '
 ™'), $cockneyreplace);

 -       $dynamic_characters = array('/\'(\d\d(?:’|\')?s)/',
 '/(\s|\A|")\'/', '/(\d+)"/', '/(\d+)\'/', '/(\S)\'([^\'\s])/',
 '/(\s|\A)"(?!\s)/', '/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/', '/(\d+)x(\d+)/');
 -       $dynamic_replacements = array('’$1','$1‘',
 '$1″', '$1′', '$1’$2', '$1“$2', '”$1',
 '’$1', '$1×$2');
 +       $dynamic_characters = array('/\'(\d\d(?:’|\')?s)/',
 '/(\s|\A|")\'/', '/(\d+)"/', '/(\d+)\'/', '/(\S)\'([^\'\s])/',
 '/(\s|\A)([\[(]*)"(?!\s)/', '/"([\])]*)(\s|\S|\Z)/', '/\'([\s.]|\Z)/',
 '/(\d+)x(\d+)/');
 +       $dynamic_replacements = array('’$1','$1‘',
 '$1″', '$1′', '$1’$2', '$1$2“$3', '”$1$2',
 '’$1', '$1×$2');

         for ( $i = 0; $i < $stop; $i++ ) {
                 $curl = $textarr[$i];
 }}}

-- 
Ticket URL: <http://trac.wordpress.org/ticket/4556>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list