8 function html2bbcode($s) {
14 '/\<pre\>(.*?)\<\/pre\>/is',
17 '/\<b\>(.*?)\<\/b\>/is',
18 '/\<i\>(.*?)\<\/i\>/is',
19 '/\<u\>(.*?)\<\/u\>/is',
20 '/\<ul\>(.*?)\<\/ul\>/is',
21 '/\<li\>(.*?)\<\/li\>/is',
22 '/\<img(.*?) src=\"(.*?)\" (.*?)\>/is',
23 '/\<div(.*?)\>(.*?)\<\/div\>/is',
25 '/\<strong\>(.*?)\<\/strong\>/is',
26 '/\<a (.*?)href=\"(.*?)\"(.*?)\>(.*?)\<\/a\>/is',
27 '/\<code\>(.*?)\<\/code\>/is',
28 '/\<span style=\"color:(.*?)\"\>(.*?)\<\/span\>/is',
29 '/\<span style=\"font-size:(.*?)\"\>(.*?)\<\/span\>/is',
30 '/\<blockquote\>(.*?)\<\/blockquote\>/is',
31 '/\<video(.*?) src=\"(.*?)\" (.*?)\>(.*?)\<\/video\>/is',
32 '/\<audio(.*?) src=\"(.*?)\" (.*?)\>(.*?)\<\/audio\>/is',
54 '[color="$1"]$2[/color]',
61 // Replace $htmltags in $text with $bbtags
62 $text = preg_replace ($htmltags, $bbtags, $s);
64 call_hooks('html2bbcode', $text);
66 // Strip all other HTML tags
67 $text = strip_tags($text);