Source for file _texturize.renderer.php
Documentation is available at _texturize.renderer.php
* This file implements the Texturize plugin for b2evolution
* @author WordPress team - http://sourceforge.net/project/memberlist.php?group_id=51422
if( !defined('DB_USER') ) die( 'Please, do not access this page directly.' );
require_once dirname(__FILE__
).
'/../renderer.class.php';
* {@internal texturize_Rendererplugin::texturize_Rendererplugin(-)}}
$this->long_desc =
'No description available';
* {@internal texturize_Rendererplugin::render(-)}}
* @param string content to render (by reference) / rendered content
* @param string Output format, see {@link format_to_output()}
* @return boolean true if we can render something for the required output format
function render( & $content, $format )
if( ! parent::render( $content, $format ) )
{ // We cannot render the required format
$textarr =
preg_split("/(<.*>)/Us", $content, -
1, PREG_SPLIT_DELIM_CAPTURE); // capture the tags as well as in between
$stop =
count($textarr); $next =
true; // loop stuff
for ($i =
0; $i <
$stop; $i++
) {
if (strlen($curl) &&
'<' !=
$curl{0} &&
$next) { // If it's not a tag
// This is a hack, look at this more later. It works pretty well though.
$cockney =
array("'tain't","'twere","'twas","'tis","'twill","'til","'bout","'nuff","'round");
$cockneyreplace =
array("’tain’t","’twere","’twas","’tis","’twill","’til","’bout","’nuff","’round");
$curl =
preg_replace("/'(\d\d(?:’|')?s)/", "’$1", $curl);
$curl =
preg_replace("/(\S)'([^'\s])/", "$1’$2", $curl);
$curl =
preg_replace('/(\s|\A)"(?!\s)/', '$1“$2', $curl);
$curl =
preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $curl);