From b1b37447592c1b1aa0a93dd136834e353073e252 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 27 Dec 2019 01:07:19 +0000 Subject: [PATCH 1/2] Support for tables in HTML2BBCode parser --- src/Content/Text/HTML.php | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/Content/Text/HTML.php b/src/Content/Text/HTML.php index 390a97f0f5..9ff615edb5 100644 --- a/src/Content/Text/HTML.php +++ b/src/Content/Text/HTML.php @@ -290,19 +290,10 @@ class HTML self::tagToBBCode($doc, 'hr', [], "[hr]", ""); - self::tagToBBCode($doc, 'table', [], "", ""); - self::tagToBBCode($doc, 'tr', [], "\n", ""); - self::tagToBBCode($doc, 'td', [], "\t", ""); - //self::node2BBCode($doc, 'table', array(), "[table]", "[/table]"); - //self::node2BBCode($doc, 'th', array(), "[th]", "[/th]"); - //self::node2BBCode($doc, 'tr', array(), "[tr]", "[/tr]"); - //self::node2BBCode($doc, 'td', array(), "[td]", "[/td]"); - //self::node2BBCode($doc, 'h1', array(), "\n\n[size=xx-large][b]", "[/b][/size]\n"); - //self::node2BBCode($doc, 'h2', array(), "\n\n[size=x-large][b]", "[/b][/size]\n"); - //self::node2BBCode($doc, 'h3', array(), "\n\n[size=large][b]", "[/b][/size]\n"); - //self::node2BBCode($doc, 'h4', array(), "\n\n[size=medium][b]", "[/b][/size]\n"); - //self::node2BBCode($doc, 'h5', array(), "\n\n[size=small][b]", "[/b][/size]\n"); - //self::node2BBCode($doc, 'h6', array(), "\n\n[size=x-small][b]", "[/b][/size]\n"); + self::tagToBBCode($doc, 'table', array(), "[table]", "[/table]"); + self::tagToBBCode($doc, 'th', array(), "[th]", "[/th]"); + self::tagToBBCode($doc, 'tr', array(), "[tr]", "[/tr]"); + self::tagToBBCode($doc, 'td', array(), "[td]", "[/td]"); self::tagToBBCode($doc, 'h1', [], "[h1]", "[/h1]"); self::tagToBBCode($doc, 'h2', [], "[h2]", "[/h2]"); From 9b750345c762cc9a58bb695a63aec4c90a0bb6cf Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 27 Dec 2019 01:15:54 +0000 Subject: [PATCH 2/2] Arrays --- src/Content/Text/HTML.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Content/Text/HTML.php b/src/Content/Text/HTML.php index 9ff615edb5..8a54c26a7c 100644 --- a/src/Content/Text/HTML.php +++ b/src/Content/Text/HTML.php @@ -290,10 +290,10 @@ class HTML self::tagToBBCode($doc, 'hr', [], "[hr]", ""); - self::tagToBBCode($doc, 'table', array(), "[table]", "[/table]"); - self::tagToBBCode($doc, 'th', array(), "[th]", "[/th]"); - self::tagToBBCode($doc, 'tr', array(), "[tr]", "[/tr]"); - self::tagToBBCode($doc, 'td', array(), "[td]", "[/td]"); + self::tagToBBCode($doc, 'table', [], "[table]", "[/table]"); + self::tagToBBCode($doc, 'th', [], "[th]", "[/th]"); + self::tagToBBCode($doc, 'tr', [], "[tr]", "[/tr]"); + self::tagToBBCode($doc, 'td', [], "[td]", "[/td]"); self::tagToBBCode($doc, 'h1', [], "[h1]", "[/h1]"); self::tagToBBCode($doc, 'h2', [], "[h2]", "[/h2]");