WordPress.org

Plugin Directory

Changeset 531580


Ignore:
Timestamp:
04/16/12 03:59:52 (6 years ago)
Author:
rsantor
Message:

tagging version 0.5

Location:
text-beautify
Files:
2 edited
3 copied

Legend:

Unmodified
Added
Removed
  • text-beautify/tags/0.5/readme.txt

    r525393 r531580  
    77Requires at least: 2.0.2 
    88Tested up to: 3.3.1 
    9 Stable tag: 0.4.2 
     9Stable tag: 0.5 
    1010 
    1111Cleans up posts and comments for sentence case or title case, fixes punctuation, makes quotes and commas curly, and allows custom enhancements. 
     
    5454== Changelog == 
    5555 
     56= 0.5 = 
     57* Plugin will now automatically leave any text contained within square brackets untouched. Example: if [some plugin="CODE"] is in your body of text, it will be passed through as-is. This is because it's very common for other WordPress plugins to use such special bracket tags to do their own special processing. 
     58 
    5659= 0.4.2 = 
    5760* Modified and corrected the way the new disabling of automatic case manipulation is processed; some automatic case adjustment was still executing 
  • text-beautify/tags/0.5/text-beautify.php

    r525393 r531580  
    55Plugin URI: http://rommelsantor.com/clog/2012/02/09/text-beautify-wordpress-plugin/ 
    66Description: Intelligently cleans up the case of blog post title/contents and/or comments to display in sentence case or title case, cleans up sloppy punctuation, makes quotes and commas curly, and allows other admin-customizable text enhancements. This is primarily targeted at the discerning blogger and designer type who is concerned with the aesthetics of the typewritten word. 
    7 Version: 0.4.2 
     7Version: 0.5 
    88Author: Rommel Santor 
    99Author URI: http://rommelsantor.com 
     
    165165      $urls = $m[0]; 
    166166 
     167    $tags = array(); 
     168    if (preg_match_all('#\[[^]]+\]#', $i_str, $m)) { 
     169      foreach ($m[0] as $orig) { 
     170        $tmp = '<!--' . md5(rand()) . '-->'; 
     171        $i_str = str_replace($orig, $tmp, $i_str); 
     172        $tags[$tmp] = $orig; 
     173      } 
     174    } 
     175 
    167176    $pieces = array(); 
    168177 
    169178    // we must account for tags so we don't process strings contained within 
    170179    if (preg_match_all('#<[^<>]+>#s', $i_str, $m)) { 
    171       $splitter = '++' . strtolower(md5(rand())) . '++'; 
    172       $placeholder = '<' . strtolower(md5(rand())) . '>'; 
     180      $splitter = '<!--++' . strtolower(md5(rand())) . '++-->'; 
     181      $placeholder = '<!--' . strtolower(md5(rand())) . '-->'; 
    173182 
    174183      $i_str = preg_replace('#<[^<>]+>#s', $splitter . $placeholder, $i_str); 
     
    199208 
    200209      if ($this->opts['enable_comma']) 
    201         $comma = md5(rand()); 
     210        $comma = '<!--' . md5(rand()) . '-->'; 
    202211      else 
    203212        $comma = ','; 
     
    273282    foreach ($urls as $url) 
    274283      $str = preg_replace('#' . preg_quote($url, '#') . '#i', $url, $str); 
     284 
     285    foreach ($tags as $tmp => $orig) 
     286      $str = preg_replace('#' . preg_quote($tmp, '#') . '#i', $orig, $str); 
    275287 
    276288    $str = preg_replace('#!rawblock(\d+)!#', '!RAWBLOCK$1!', $str); 
  • text-beautify/trunk/readme.txt

    r525393 r531580  
    77Requires at least: 2.0.2 
    88Tested up to: 3.3.1 
    9 Stable tag: 0.4.2 
     9Stable tag: 0.5 
    1010 
    1111Cleans up posts and comments for sentence case or title case, fixes punctuation, makes quotes and commas curly, and allows custom enhancements. 
     
    5454== Changelog == 
    5555 
     56= 0.5 = 
     57* Plugin will now automatically leave any text contained within square brackets untouched. Example: if [some plugin="CODE"] is in your body of text, it will be passed through as-is. This is because it's very common for other WordPress plugins to use such special bracket tags to do their own special processing. 
     58 
    5659= 0.4.2 = 
    5760* Modified and corrected the way the new disabling of automatic case manipulation is processed; some automatic case adjustment was still executing 
  • text-beautify/trunk/text-beautify.php

    r525393 r531580  
    55Plugin URI: http://rommelsantor.com/clog/2012/02/09/text-beautify-wordpress-plugin/ 
    66Description: Intelligently cleans up the case of blog post title/contents and/or comments to display in sentence case or title case, cleans up sloppy punctuation, makes quotes and commas curly, and allows other admin-customizable text enhancements. This is primarily targeted at the discerning blogger and designer type who is concerned with the aesthetics of the typewritten word. 
    7 Version: 0.4.2 
     7Version: 0.5 
    88Author: Rommel Santor 
    99Author URI: http://rommelsantor.com 
     
    165165      $urls = $m[0]; 
    166166 
     167    $tags = array(); 
     168    if (preg_match_all('#\[[^]]+\]#', $i_str, $m)) { 
     169      foreach ($m[0] as $orig) { 
     170        $tmp = '<!--' . md5(rand()) . '-->'; 
     171        $i_str = str_replace($orig, $tmp, $i_str); 
     172        $tags[$tmp] = $orig; 
     173      } 
     174    } 
     175 
    167176    $pieces = array(); 
    168177 
    169178    // we must account for tags so we don't process strings contained within 
    170179    if (preg_match_all('#<[^<>]+>#s', $i_str, $m)) { 
    171       $splitter = '++' . strtolower(md5(rand())) . '++'; 
    172       $placeholder = '<' . strtolower(md5(rand())) . '>'; 
     180      $splitter = '<!--++' . strtolower(md5(rand())) . '++-->'; 
     181      $placeholder = '<!--' . strtolower(md5(rand())) . '-->'; 
    173182 
    174183      $i_str = preg_replace('#<[^<>]+>#s', $splitter . $placeholder, $i_str); 
     
    199208 
    200209      if ($this->opts['enable_comma']) 
    201         $comma = md5(rand()); 
     210        $comma = '<!--' . md5(rand()) . '-->'; 
    202211      else 
    203212        $comma = ','; 
     
    273282    foreach ($urls as $url) 
    274283      $str = preg_replace('#' . preg_quote($url, '#') . '#i', $url, $str); 
     284 
     285    foreach ($tags as $tmp => $orig) 
     286      $str = preg_replace('#' . preg_quote($tmp, '#') . '#i', $orig, $str); 
    275287 
    276288    $str = preg_replace('#!rawblock(\d+)!#', '!RAWBLOCK$1!', $str); 
Note: See TracChangeset for help on using the changeset viewer.