Ticket #891: bbcode.diff
File bbcode.diff, 1.3 KB (added by , 15 years ago) |
---|
-
html/inc/text_transform.inc
122 122 "@\[quote\](.*?)\[/quote\]@is", 123 123 "@\[list\](.*?)\[/list\]@is", 124 124 "@\[list=1\](.*?)\[/list\]@is", 125 "@\[pre\](.*?)\[/pre\]@ is",125 "@\[pre\](.*?)\[/pre\]@eis", 126 126 "@\[img\]$urlregex\[/img\]@is", 127 127 "@\[color=(?:\"?)(.{3,8})(?:\"?)\](.*?)\[/color\]@is", 128 128 "@((?:<ol>|<ul>).*?)\n\*([^\n]+)\n(.*?(</ol>|</ul>))@is", … … 153 153 "<blockquote class='postbody'>\\1</blockquote>", 154 154 "<ul>\\1</ul><p>", 155 155 "<ol>\\1</ol><p>", 156 " <pre>\\1</pre>",156 "'<pre>'.remove_br('\\1').'</pre>'", 157 157 "<img src=\"http://\\2\">", 158 158 "<font color=\"\\1\">\\2</font>", 159 159 "\\1<li>\\2\n\\3", … … 186 186 return str_replace("[", "[", $text); 187 187 } 188 188 189 /** 190 * Removes any <br> tags added by nl2br which are not wanted, for example inside <pre> containers 191 * The original \n was retained after the br when it was added 192 **/ 193 function remove_br($text){ 194 return str_replace("<br />", "", $text); 195 } 196 189 197 // Make links open in new windows. 190 198 function externalize_links($text) { 191 199 // TODO: Convert this to PCRE