Plugin Directory

Changeset 1729782


Ignore:
Timestamp:
09/14/2017 09:52:58 AM (9 years ago)
Author:
enivid
Message:

Version 11

Location:
post-typographer/trunk
Files:
2 edited

Legend:

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

    r821548 r1729782  
    22Tags: typography, formatting, post, posts, plugin
    33Requires at least: 2.5
    4 Tested up to: 3.8
    5 Stable tag: 10
     4Tested up to: 4.8.1
     5Stable tag: 11
     6Author: Andriy Moraru
     7Version: 11
     8Author URI: https://www.earnforex.com
    69
    7 Adds non-breaking spaces, <nobr> tags, common spaces, tags and dashes where needed. Works with English texts only.
     10
     11Adds non-breaking spaces, `<nobr>` tags, common spaces, tags and dashes where needed. Works with English texts only.
    812
    913== Description ==
    1014
    11 When you publish a post or update an already published post, this plugin will
    12 format the post's content to certain typographic rules:
     15When you publish a post or update an already published post, this plugin will format the post's content to certain typographic rules:
    1316
    14 1. All hyphens between two words (surrounded by spaces) will be transformed to
    15 m-dashes with the non-breaking spaces ahead of them.
    16 2. All hyphens between digits (without spaces) will be transformed to n-dashes.
    17 But it tries to preserve phone numbers.
    18 3. All spaces following these words will be replaced with the non-breaking
    19 spaces:
     171. All hyphens between two words (surrounded by spaces) will be transformed to m-dashes with the non-breaking spaces ahead of them.
    2018
     192. All hyphens between digits (without spaces) will be transformed to n-dashes. But it tries to preserve phone numbers.
     20
     213. All spaces following these words will be replaced with the non-breaking spaces:
    2122* at
    22 
    2323* or
    24 
    2524* and
    26 
    2725* the
    28 
    2926* a
    30 
    3127* an
    32 
    3328* in
    34 
    3529* on
    36 
    3730* of
    38 
    3931* for
    40 
    4132* to
    42 
    4333* as
    44 
    4534* i
    46 
    4735* or
    48 
    4936* my
    5037
    51384. Double and more spaces are replaced with the single ones.
    5239
    53 5. All misplaced spaces near dots, colons, semicolons, exclamation
    54 marks and question marks are fixed, where possible.
     405. All misplaced spaces near dots, colons, semicolons, exclamation marks and question marks are fixed, where possible.
    5541
    56 6. Composed words with hyphens in them (e.g. "easy-to-use") will be wrapped in
    57 `<nobr></nobr>` tags.
     426. Composed words with hyphens in them (e.g. *easy-to-use*) will be wrapped in `<nobr></nobr>` tags.
    5843
    59447. `<pre></pre>` tag and its contents are preserved.
     
    6146Porblems:
    6247
    63 1. The plugin **won't** mess with the HTML tags or other mark-up tags delimited
    64 with < and >. It **will** mess with the Javascript code and such constructions
    65 as:`
     481. The plugin **will not** mess with the HTML tags or other mark-up tags delimited with < and >. It **will** mess with the Javascript code and such constructions as:
     49`
    6650    [code]
    6751    bla bla bla
    6852    [/code]
    6953`
    70 Though, since version 6 the mess is minimized for [code] and [video] tags.
    7154
    72 2. The n-dash thing will mess up with the phone numbers that have only one
    73 hyphen in them. They will be confused with the value ranges.
     55Though, since version 6, the mess is minimized for [code] and [video] tags.
     56
     572. The n-dash thing will mess up with the phone numbers that have only one hyphen in them. They will be confused with the value ranges.
    7458
    7559== Installation ==
    7660
    77 1. Upload `typopost.php` to the `/wp-content/plugins/` directory.
    78 2. Activate the plugin through the 'Plugins' menu in your WordPress Admin section.
     61= From your WordPress dashboard =
     62
     631. Visit ‘Plugins > Add New’
     642. Search for ‘Post Typographer’
     653. Activate Post Typographer from your Plugins page.
     66
     67= From WordPress.org =
     68
     691. Download Post Typographer.
     702. Upload the ‘post-typographer’ directory to your ‘/wp-content/plugins/’ directory.
     713. Activate Post Typographer from your Plugins page.
    7972
    8073== Changelog ==
    8174
     75= 11 =
     76* Fixed: Contents of <pre></pre> tag aren't messed up with typographing.
     77
    8278= 10 =
    83 * Fixed: Contents of <pre></pre> tag aren't messed up with typographing.
     79* Fixed: Contents of `<pre></pre>` tag aren't messed up with typographing.
    8480
    8581= 9 =
     
    8884
    8985= 8 =
    90 * Added: Tries to remove unneded spaces before colons and semicolons without
    91 messing with the smiles.
     86* Added: Tries to remove unneeded spaces before colons and semicolons without messing with the smiles.
    9287* Added: Word 'by' included to the list of words for `&nbsp;` after them.
    9388
    9489= 7 =
    95 * Fixed: No longer removes spaces before colons and semicolons - not to mess
    96 with the smiles.
     90* Fixed: No longer removes spaces before colons and semicolons - not to mess with the smiles.
    9791
    9892= 6 =
    99 * Fixed: Double (and more) warpping with the <nobr> tags.
    100 * Fixed: <nobr> wrapping and some other formatting in the [code] and [video]
    101 embedded text.
     93* Fixed: Double (and more) warpping with the `<nobr>` tags.
     94* Fixed: `<nobr>` wrapping and some other formatting in the [code] and [video] embedded text.
    10295
    10396= 5 =
    104 * Added: Wrapping the composed words with hyphens with <nobr> tags.
     97* Added: Wrapping the composed words with hyphens with `<nobr>` tags.
    10598
    10699= 4 =
    107100* Fixed: Nasty double-space bug on post-updating.
    108101* Fixed: M-dash placement didn't work in version 3.
    109 * Fixed: N-dashes are now placed correctly even if the value ranges are near the
    110 beginning or the end of the text.
     102* Fixed: N-dashes are now placed correctly even if the value ranges are near the beginning or the end of the text.
    111103
    112104= 3 =
    113105* Added: Replaces misplaced spaces near punctuation marks.
    114 * Fixed: Phone numbers and dates are now avoided (except single-hyphen phone
    115 numbers) when the hyphens in the value ranges are transformed into n-dashes.
     106* Fixed: Phone numbers and dates are now avoided (except single-hyphen phone numbers) when the hyphens in the value ranges are transformed into n-dashes.
    116107
    117108= 2 =
     
    124115== Thanks to ==
    125116
    126 [Typograf by Artemy Lebedev](http://www.artlebedev.ru/tools/typograf/)
     117[Typograf by Artemy Lebedev](https://www.artlebedev.ru/typograf/)
  • post-typographer/trunk/typopost.php

    r288046 r1729782  
    22/*
    33Plugin Name: Post Typographer
    4 Plugin URI: http://wordpress.org/extend/plugins/post-typographer/
     4Plugin URI: https://wordpress.org/plugins/post-typographer/
    55Description: Formats the text according to typography rules. Works with English texts only.
    66Author: Andriy Moraru
    7 Version: 10
    8 Author URI: http://www.topforexnews.com
     7Version: 11
     8Author URI: https://www.earnforex.com
    99*/
    1010
     
    5454
    5555            //Add m-dashes with a preceeding non-breaking space, in place of the hyphens, where neeeded
    56             $without_html[$i] = str_replace(' - ', '&nbsp;&#8212; ', $without_html[$i]);
     56            $without_html[$i] = str_replace(' - ', '&nbsp;&mdash; ', $without_html[$i]);
    5757
    5858            //Get the array of strings made of text without text wrapped with [] tags
     
    6868                $without_square[$j] = preg_replace('@(,|!|\?)([a-z]+)@i', "\$1 \$2", $without_square[$j]);
    6969                //Add n-dashes in place of hyphens in the numeric ranges, skipping the supposed phone numbers
    70                 $without_square[$j] = preg_replace('@((^|[^\-^0-9])[0-9]+)-([0-9]+([^0-9^\-]|$))@', "\$1&#8211;\$3", $without_square[$j]);
     70                $without_square[$j] = preg_replace('@((^|[^\-^0-9])[0-9]+)-([0-9]+([^0-9^\-]|$))@', "\$1&ndash;\$3", $without_square[$j]);
    7171                //Wrap composed words with hyphens with <nobr> tag
    7272                $without_square[$j] = preg_replace('@(([a-zA-Z]+)(-([a-zA-Z]+))+)@', "<nobr>\$1</nobr>", $without_square[$j]);
Note: See TracChangeset for help on using the changeset viewer.