8 function html2bbcode($s) {
14 '/\<b\>(.*?)\<\/b\>/is',
15 '/\<i\>(.*?)\<\/i\>/is',
16 '/\<u\>(.*?)\<\/u\>/is',
17 '/\<ul\>(.*?)\<\/ul\>/is',
18 '/\<li\>(.*?)\<\/li\>/is',
19 '/\<img(.*?) src=\"(.*?)\" (.*?)\>/is',
20 '/\<div(.*?)\>(.*?)\<\/div\>/is',
22 '/\<strong\>(.*?)\<\/strong\>/is',
23 '/\<a href=\"(.*?)\"(.*?)\>(.*?)\<\/a\>/is',
24 '/\<code\>(.*?)\<\/code\>/is',
25 '/\<span style=\"color:(.*?)\"\>(.*?)\<\/span\>/is',
26 '/\<blockquote\>(.*?)\<\/blockquote\>/is',
27 '/\<video(.*?) src=\"(.*?)\" (.*?)\>(.*?)\<\/video\>/is',
28 '/\<audio(.*?) src=\"(.*?)\" (.*?)\>(.*?)\<\/audio\>/is',
47 '[color="$1"]$2[/color]',
53 // Replace $htmltags in $text with $bbtags
54 $text = preg_replace ($htmltags, $bbtags, $s);
56 call_hooks('html2bbcode', $text);
58 // Strip all other HTML tags
59 $text = strip_tags($text);