aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/html2bbcode.php7
-rw-r--r--tests/unit/includes/BBCodeTest.php4
2 files changed, 6 insertions, 5 deletions
diff --git a/include/html2bbcode.php b/include/html2bbcode.php
index 8c35cdf03..277b0e640 100644
--- a/include/html2bbcode.php
+++ b/include/html2bbcode.php
@@ -217,14 +217,11 @@ 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(), "[table]", "[/table]");
node2bbcode($doc, 'th', array(), "[th]", "[/th]");
node2bbcode($doc, 'tr', array(), "[tr]", "[/tr]");
node2bbcode($doc, 'td', array(), "[td]", "[/td]");
+ node2bbcode($doc, 'table', array(), "[table]", "[/table]");
+
node2bbcode($doc, 'h1', array(), "[h1]", "[/h1]");
node2bbcode($doc, 'h2', array(), "[h2]", "[/h2]");
diff --git a/tests/unit/includes/BBCodeTest.php b/tests/unit/includes/BBCodeTest.php
index daa66bf72..30ea00ba6 100644
--- a/tests/unit/includes/BBCodeTest.php
+++ b/tests/unit/includes/BBCodeTest.php
@@ -266,6 +266,10 @@ class BBCodeTest extends UnitTestCase {
'del tag' => [
'some <del>strike through</del> text',
'some [s]strike through[/s] text'
+ ],
+ 'table' => [
+ '<table><tr><td>row1, col1</td><td>row1, col2</td></tr><tr><td>row2, col1</td><td>row2, col2</td></tr></table>',
+ '[table][tr][td]row1, col1[/td][td]row1, col2[/td][/tr][tr][td]row2, col1[/td][td]row2, col2[/td][/tr][/table]'
]
];
}