From 5754ea828d21c34d817f4c0f03189829db259157 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 8 Feb 2024 20:22:26 +0000 Subject: =?UTF-8?q?move=20parsing=20of=20a=20tags=20up=C3=83=20to=20fix=20?= =?UTF-8?q?an=20issue=20where=20mentions=20arriving=20from=20masto=20did?= =?UTF-8?q?=20not=20parse=20correctly,=20fix=20typo=20when=20restoring=20t?= =?UTF-8?q?emporary=20linebreaks=20and=20remove=20redundant=20codeline=20w?= =?UTF-8?q?hen=20converting=20span=20tags?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/html2bbcode.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/html2bbcode.php b/include/html2bbcode.php index e2fa94326..61d530e7d 100644 --- a/include/html2bbcode.php +++ b/include/html2bbcode.php @@ -195,12 +195,13 @@ function html2bbcode($message) // Use a temporary tag to keep line breaks node2bbcode($doc, 'br', array(), '[br]', ''); + node2bbcode($doc, 'a', array('href'=>'/(.+)/'), '[url=$1]', '[/url]'); + node2bbcode($doc, 'p', array('class'=>'MsoNormal'), "\n", ""); node2bbcode($doc, 'div', array('class'=>'MsoNormal'), "\r", ""); node2bbcode($doc, 'span', array(), "", ""); - node2bbcode($doc, 'span', array(), "", ""); node2bbcode($doc, 'pre', array(), "", ""); node2bbcode($doc, 'div', array(), "\r", "\r"); node2bbcode($doc, 'p', array(), "\n", "\n"); @@ -227,8 +228,6 @@ function html2bbcode($message) node2bbcode($doc, 'h5', array(), "\n\n[h5]", "[/h5]\n"); node2bbcode($doc, 'h6', array(), "\n\n[h6]", "[/h6]\n"); - node2bbcode($doc, 'a', array('href'=>'/(.+)/'), '[url=$1]', '[/url]'); - node2bbcode($doc, 'img', array('src'=>'/(.+)/', 'width'=>'/(\d+)/', 'height'=>'/(\d+)/'), '[img=$2x$3]$1', '[/img]'); node2bbcode($doc, 'img', array('src'=>'/(.+)/', 'alt'=>'/(.+)/'), '[img=$1]$2', '[/img]'); node2bbcode($doc, 'img', array('src'=>'/(.+)/'), '[img]$1', '[/img]'); @@ -305,7 +304,7 @@ function html2bbcode($message) array('[b]', '[/b]', '[i]', '[/i]'), $message); // Restore linebreaks from temp tag - $message = str_replace('[br] ', "\n", $message); + $message = str_replace('[br]', "\n", $message); // Handling Yahoo style of mails // $message = str_replace('[hr][b]From:[/b]', '[quote][b]From:[/b]', $message); -- cgit v1.2.3