$replace) { $ac_text_search[] = $search; $ac_text_replace[] = $replace; } } if (!isset($ac_ordinals_search) && get_option('ac_ordinals')) { $ac_ordinals_search = get_option('ac_ordinals_trans'); } $output = ''; // Capture tags and everything inside them $textarr = preg_split("/(<.*>)/Us", $text, -1, PREG_SPLIT_DELIM_CAPTURE); $stop = count($textarr); $next = true; // loop stuff for ($i = 0; $i < $stop; $i++) { $curl = $textarr[$i]; if (isset($curl{0}) && '<' != $curl{0} && $next) { // If it's not a tag if (get_option('ac_symbols')) { $curl = str_replace('---', '—', $curl); $curl = str_replace(' -- ', ' — ', $curl); $curl = str_replace('--', '–', $curl); $curl = str_replace('xn–', 'xn--', $curl); $curl = preg_replace('/(\d+)x(\d+)/', "$1×$2", $curl); } if (get_option('ac_ordinals')) { $curl = preg_replace("/\b(\d+)($ac_ordinals_search)\b/",'$1$2',$curl); } if (get_option('ac_emphasis')) { $curl = preg_replace('/\*(\S(.*?\S)?)\*/','$1',$curl); $curl = preg_replace('/_(\S(.*?\S)?)_/','$1',$curl); } if (get_option('ac_text')) { // AutoCorrect entries $curl = str_replace($ac_text_search, $ac_text_replace, $curl); } if (get_option('ac_quotes')) { $curl = str_replace('``', '“', $curl); $curl = str_replace("'s", '’s', $curl); $curl = preg_replace("/'(\d\d(?:’|')?s)/", "’$1", $curl); $curl = preg_replace('/(\s|\A|")\'/', '$1‘', $curl); $curl = preg_replace('/(\d+)"/', '$1″', $curl); $curl = preg_replace("/(\d+)'/", '$1′', $curl); $curl = preg_replace("/(\S)'([^'\s])/", "$1’$2", $curl); $curl = preg_replace('/(\s|\A)"(?!\s)/', '$1“$2', $curl); $curl = preg_replace('/"(\s|\S|\Z)/', '”$1', $curl); $curl = preg_replace("/'([\s.]|\Z)/", '’$1', $curl); $curl = str_replace("''", '”', $curl); } if (get_option('ac_urls')) { $curl = preg_replace('/(\s)(http|https|ftp|file)(:\/\/\S+)/','$1$2',$curl); $curl = preg_replace('/(\s)(www\.\S+)/','$1$2',$curl); } } elseif (strstr($curl, ''); $ac_key = str_replace($specialcharss,$specialcharsr,$ac_key); $ac_value = str_replace($specialcharss,$specialcharsr,$ac_value); if (array_key_exists($ac_key,$ac_text_trans)) { $msg = sprintf(__('AutoCorrect item “%s” was changed.','autocorrect'),$ac_key); } else { $msg = sprintf(__('AutoCorrect item “%s” was added.','autocorrect'),$ac_key); } $ac_text_trans[$ac_key] = $ac_value; update_option('ac_text_trans',$ac_text_trans); break; } if ($msg) { echo '

'.$msg.'

'; } ?>






/> '; echo ' '; } ?>

$value) { $style = ($i % 2) ? ' class="alternate"' : ''; ++$i; $urlkey = urlencode($key); # Escape tags so they don't affect the page layout $key = str_replace(array('<','>'), array('<','>'), $key); $value = str_replace(array('<','>'), array('<','>'), $value); ?>>
','autocorrect');" class="delete">