]> git.mxchange.org Git - friendica.git/blobdiff - include/html2bbcode.php
more plugin hooks
[friendica.git] / include / html2bbcode.php
index 2ae0df8f688123077eca1b070b2ae749247de254..a2e53a81b8682f8e9ebc2693e9d013d3e5b1e804 100644 (file)
@@ -6,6 +6,7 @@ function html2bbcode($s) {
 
 // Tags to Find
 $htmltags = array(
+                                               '/\n/is',
                         '/\<b\>(.*?)\<\/b\>/is',
                         '/\<i\>(.*?)\<\/i\>/is',
                         '/\<u\>(.*?)\<\/u\>/is',
@@ -17,14 +18,14 @@ $htmltags = array(
                         '/\<strong\>(.*?)\<\/strong\>/is',
                         '/\<a href=\"(.*?)\"(.*?)\>(.*?)\<\/a\>/is',
                        '/\<code\>(.*?)\<\/code\>/is',
-                       '/\<font color=(.*?)\>(.*?)\<\/font\>',
-                       '/\<font color=\"(.*?)\"\>(.*?)\<\/font\>',
+                       '/\<span style=\"color:(.*?)\"\>(.*?)\<\/span\>/is',
                        '/\<blockquote\>(.*?)\<\/blockquote\>/is',
 
                         );
 
 // Replace with
 $bbtags = array(
+                                               '',
                         '[b]$1[/b]',
                         '[i]$1[/i]',
                         '[u]$1[/u]',
@@ -32,12 +33,11 @@ $bbtags = array(
                         '[*]$1',
                         '[img]$2[/img]',
                         '$2',
-                        '\n',
+                        "\n",
                         '[b]$1[/b]',
                         '[url=$1]$3[/url]',
                        '[code]$1[/code]',
                        '[color="$1"]$2[/color]',
-                       '[color="$1"]$2[/color]',
                        '[quote]$1[/quote]',
                         );