From f0faa7f9b06481200c21459f9c53db457b7941b3 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 14 Jan 2018 16:45:33 -0800 Subject: support tables in markdown posts/comments (but not table alignment); and do not support iframes from html source. --- include/html2bbcode.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'include/html2bbcode.php') diff --git a/include/html2bbcode.php b/include/html2bbcode.php index f67231847..4166299db 100644 --- a/include/html2bbcode.php +++ b/include/html2bbcode.php @@ -188,13 +188,14 @@ 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(), "", ""); +// 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[h1]", "[/h1]\n"); node2bbcode($doc, 'h2', array(), "\n\n[h2]", "[/h2]\n"); @@ -211,7 +212,7 @@ function html2bbcode($message) node2bbcode($doc, 'video', array('src'=>'/(.+)/'), '[video]$1', '[/video]'); node2bbcode($doc, 'audio', array('src'=>'/(.+)/'), '[audio]$1', '[/audio]'); - node2bbcode($doc, 'iframe', array('src'=>'/(.+)/'), '[iframe]$1', '[/iframe]'); +// node2bbcode($doc, 'iframe', array('src'=>'/(.+)/'), '[iframe]$1', '[/iframe]'); node2bbcode($doc, 'code', array(), '[code]', '[/code]'); -- cgit v1.2.3