Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function bb_decodeit( $matches ) {
- $text = $matches[2];
- $trans_table = array_flip(get_html_translation_table(HTML_ENTITIES));
- $text = strtr($text, $trans_table);
- $text = str_replace('<br />', '<coded_br />', $text);
- $text = str_replace('<p>', '<coded_p>', $text);
- $text = str_replace('</p>', '</coded_p>', $text);
- $text = str_replace(array('&','&'), '&', $text);
- $text = str_replace(''', "'", $text);
- if ( '<pre><code>' == $matches[1] )
- $text = "\n$text\n";
- //return "`$text`";
- return "<code>$text</code>";
- }
- function bb_code_trick( $text ) {
- $text = str_replace(array("\r\n", "\r"), "\n", $text);
- //$text = preg_replace_callback("|(`)(.*?)`|", 'bb_encodeit', $text);
- //$text = preg_replace_callback("!(^|\n)`(.*?)`!s", 'bb_encodeit', $text);
- return $text;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement