diff options
author | Mario <mario@mariovavti.com> | 2024-02-08 20:22:26 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2024-02-08 20:22:26 +0000 |
commit | 5754ea828d21c34d817f4c0f03189829db259157 (patch) | |
tree | 01a7e971ab6e7c193d12653b69522f603899f27c /include | |
parent | 5fbc203367baffc65e631358478b5d6be5943999 (diff) | |
download | volse-hubzilla-5754ea828d21c34d817f4c0f03189829db259157.tar.gz volse-hubzilla-5754ea828d21c34d817f4c0f03189829db259157.tar.bz2 volse-hubzilla-5754ea828d21c34d817f4c0f03189829db259157.zip |
move parsing of a tags upà to fix an issue where mentions arriving from masto did not parse correctly, fix typo when restoring temporary linebreaks and remove redundant codeline when converting span tags
Diffstat (limited to 'include')
-rw-r--r-- | include/html2bbcode.php | 7 |
1 files changed, 3 insertions, 4 deletions
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); |