]> git.mxchange.org Git - friendica.git/blobdiff - include/html2bbcode.php
Merge branch 'master' of https://github.com/fabrixxm/friendika into fabrixxm-master
[friendica.git] / include / html2bbcode.php
index 7cacadd65ce04464642e80f42ce29297a6f548ac..6af8df824e76bbf35552e881b81aaa2c783364c5 100644 (file)
@@ -11,6 +11,9 @@ function html2bbcode($s) {
 
        $htmltags = array(
                '/\n/is',
+               '/\<pre\>(.*?)\<\/pre\>/is',
+               '/\<p(.*?)\>/is',
+               '/\<\/p\>/is',
                '/\<b\>(.*?)\<\/b\>/is',
                '/\<i\>(.*?)\<\/i\>/is',
                '/\<u\>(.*?)\<\/u\>/is',
@@ -20,7 +23,7 @@ function html2bbcode($s) {
                '/\<div(.*?)\>(.*?)\<\/div\>/is',
                '/\<br(.*?)\>/is',
                '/\<strong\>(.*?)\<\/strong\>/is',
-               '/\<a href=\"(.*?)\"(.*?)\>(.*?)\<\/a\>/is',
+               '/\<a (.*?)href=\"(.*?)\"(.*?)\>(.*?)\<\/a\>/is',
                '/\<code\>(.*?)\<\/code\>/is',
                '/\<span style=\"color:(.*?)\"\>(.*?)\<\/span\>/is',
                '/\<blockquote\>(.*?)\<\/blockquote\>/is',
@@ -32,6 +35,9 @@ function html2bbcode($s) {
        // Replace with
 
        $bbtags = array(
+               '',
+               '[code]$1[/code]',
+               '',
                "\n",
                '[b]$1[/b]',
                '[i]$1[/i]',
@@ -42,7 +48,7 @@ function html2bbcode($s) {
                '$2',
                "\n",
                '[b]$1[/b]',
-               '[url=$1]$3[/url]',
+               '[url=$2]$4[/url]',
                '[code]$1[/code]',
                '[color="$1"]$2[/color]',
                '[quote]$1[/quote]',