Plugin Directory

Changeset 177157


Ignore:
Timestamp:
11/26/2009 09:48:09 AM (16 years ago)
Author:
enivid
Message:
 
Location:
post-typographer/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • post-typographer/trunk/readme.txt

    r176896 r177157  
    33Requires at least: 2.5
    44Tested up to: 2.8.6
    5 Stable tag: 7
     5Stable tag: 8
    66
    77Adds non-breaking spaces, <nobr> tags, common spaces, tags and dashes where needed. Works with English texts only.
     
    3434* my
    35354. Double and more spaces are replaced with the single ones.
    36 5. All misplaced spaces near dots, colons, exclamation
     365. All misplaced spaces near dots, colons, semicolons, exclamation
    3737marks and question marks are fixed, where possible.
    38386. Composed words with hyphens in them (e.g. "easy-to-use") will be wrapped in
     
    5959
    6060== Changelog ==
     61
     62= 8 =
     63* Added: Tries to remove unneded spaces before colons and semicolons without
     64messing with the smiles.
     65* Added: Word 'by' included to the list of words for `&nbsp;` after them.
    6166
    6267= 7 =
  • post-typographer/trunk/typopost.php

    r176896 r177157  
    55Description: Formats the text according to typography rules. Works with English texts only.
    66Author: Andriy Moraru
    7 Version: 7
     7Version: 8
    88Author URI: http://www.topforexnews.com
    99*/
     
    5353        {
    5454            //Remove space before the punctuation marks that are placed directly after the words
    55             $without_square[$j] = preg_replace('@ (\.|,|!|\?)@', "\$1", $without_square[$j]);
     55            $without_square[$j] = preg_replace('@ (\.|,|(: )|(; )|!|\?)@', "\$1", $without_square[$j]);
    5656            //Add space after the punctuation marks where needed
    5757            $without_square[$j] = preg_replace('@(,|!|\?)([a-z]+)@i', "\$1 \$2", $without_square[$j]);
     
    6161            $without_square[$j] = preg_replace('@(([a-zA-Z]+)(-([a-zA-Z]+))+)@', "<nobr>\$1</nobr>", $without_square[$j]);
    6262            //Add non-breaking spaces
    63             $new_content .= preg_replace("@(?<!')\b(at|or|and|the|a|an|in|on|of|for|to|as|i|or|my) @i", "\$1&nbsp;", $without_square[$j]);
     63            $new_content .= preg_replace("@(?<!')\b(at|or|and|the|a|by|an|in|on|of|for|to|as|i|or|my) @i", "\$1&nbsp;", $without_square[$j]);
    6464            if ($j < $n_square) $new_content .= $square[0][$j];
    6565        }
Note: See TracChangeset for help on using the changeset viewer.