aboutsummaryrefslogtreecommitdiffstats
path: root/include/html2bbcode.php
diff options
context:
space:
mode:
authorMichael <icarus@dabo.de>2012-02-19 21:07:45 +0100
committerMichael <icarus@dabo.de>2012-02-19 21:07:45 +0100
commit064c843119576c1345a61a531dfaa1076a54f3f0 (patch)
treea1ebc4daa503ba96be6ee54951414f83aa2ca7df /include/html2bbcode.php
parent8c8efbdf644fc645e61ba279ab52617d173cee45 (diff)
downloadvolse-hubzilla-064c843119576c1345a61a531dfaa1076a54f3f0.tar.gz
volse-hubzilla-064c843119576c1345a61a531dfaa1076a54f3f0.tar.bz2
volse-hubzilla-064c843119576c1345a61a531dfaa1076a54f3f0.zip
Handling nested bbcodes. Some small design changes in html2bbcode. Change in poller.php is just for testing purposes.
Diffstat (limited to 'include/html2bbcode.php')
-rwxr-xr-xinclude/html2bbcode.php35
1 files changed, 21 insertions, 14 deletions
diff --git a/include/html2bbcode.php b/include/html2bbcode.php
index 1b4b5e99a..4297ff2f9 100755
--- a/include/html2bbcode.php
+++ b/include/html2bbcode.php
@@ -187,9 +187,13 @@ function html2bbcode($message)
node2bbcode($doc, 'hr', array(), "[hr]", "");
- node2bbcode($doc, 'table', array(), "", "");
- node2bbcode($doc, 'tr', array(), "\n", "");
- node2bbcode($doc, 'td', array(), "\t", "");
+ //node2bbcode($doc, 'table', array(), "", "");
+ //node2bbcode($doc, 'tr', array(), "\n", "");
+ //node2bbcode($doc, 'td', array(), "\t", "");
+ node2bbcode($doc, 'table', array(), "[table]", "[/table]");
+ node2bbcode($doc, 'th', array(), "[th]", "[/th]");
+ node2bbcode($doc, 'tr', array(), "[tr]", "[/tr]");
+ node2bbcode($doc, 'td', array(), "[td]", "[/td]");
node2bbcode($doc, 'h1', array(), "\n\n[size=xx-large][b]", "[/b][/size]\n");
node2bbcode($doc, 'h2', array(), "\n\n[size=x-large][b]", "[/b][/size]\n");
@@ -246,27 +250,30 @@ function html2bbcode($message)
$message = str_replace("\n\n\n", "\n\n", $message);
} while ($oldmessage != $message);
- $message = str_replace(array(
+ do {
+ $oldmessage = $message;
+ $message = str_replace(array(
"[/size]\n\n",
- "\n\n[hr]\n",
- "\n[hr]\n\n",
- "\n\n[list",
- "[/list]\n\n",
+ "\n[hr]",
+ "[hr]\n",
+ "\n[list",
+ "[/list]\n",
"\n[/list]",
"[list]\n",
"[list=1]\n",
- "\n\n[*]"),
+ "\n[*]"),
array(
"[/size]\n",
- "\n[hr]\n",
- "\n[hr]\n",
- "\n[list",
- "[/list]\n",
+ "[hr]",
+ "[hr]",
+ "[list",
+ "[/list]",
"[/list]",
"[list]",
"[list=1]",
- "\n[*]"),
+ "[*]"),
$message);
+ } while ($message != $oldmessage);
$message = str_replace(array('[b][b]', '[/b][/b]', '[i][i]', '[/i][/i]'),
array('[b]', '[/b]', '[i]', '[/i]'), $message);