diff options
author | Mario <mario@mariovavti.com> | 2024-02-09 11:20:46 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2024-02-09 11:20:46 +0000 |
commit | 067a66b9278e3c8ff2c624f38f2817715eb8a316 (patch) | |
tree | 61ef1bf5cec4c5840df78483819b246767f349b1 /include/html2bbcode.php | |
parent | 096fad5e8c71aea99d469b844d99fe9c9d58bc77 (diff) | |
download | volse-hubzilla-067a66b9278e3c8ff2c624f38f2817715eb8a316.tar.gz volse-hubzilla-067a66b9278e3c8ff2c624f38f2817715eb8a316.tar.bz2 volse-hubzilla-067a66b9278e3c8ff2c624f38f2817715eb8a316.zip |
fix some whitespace issues after recent changes
Diffstat (limited to 'include/html2bbcode.php')
-rw-r--r-- | include/html2bbcode.php | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/include/html2bbcode.php b/include/html2bbcode.php index c00df8f23..e97748a59 100644 --- a/include/html2bbcode.php +++ b/include/html2bbcode.php @@ -221,12 +221,12 @@ function html2bbcode($message) 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"); - node2bbcode($doc, 'h3', array(), "\n\n[h3]", "[/h3]\n"); - node2bbcode($doc, 'h4', array(), "\n\n[h4]", "[/h4]\n"); - node2bbcode($doc, 'h5', array(), "\n\n[h5]", "[/h5]\n"); - node2bbcode($doc, 'h6', array(), "\n\n[h6]", "[/h6]\n"); + node2bbcode($doc, 'h1', array(), "[h1]", "[/h1]"); + node2bbcode($doc, 'h2', array(), "[h2]", "[/h2]"); + node2bbcode($doc, 'h3', array(), "[h3]", "[/h3]"); + node2bbcode($doc, 'h4', array(), "[h4]", "[/h4]"); + node2bbcode($doc, 'h5', array(), "[h5]", "[/h5]"); + node2bbcode($doc, 'h6', array(), "[h6]", "[/h6]"); node2bbcode($doc, 'img', array('src'=>'/(.+)/', 'width'=>'/(\d+)/', 'height'=>'/(\d+)/'), '[img=$2x$3]$1', '[/img]'); node2bbcode($doc, 'img', array('src'=>'/(.+)/', 'alt'=>'/(.+)/'), '[img=$1]$2', '[/img]'); @@ -279,6 +279,8 @@ function html2bbcode($message) $oldmessage = $message; $message = str_replace(array( "[/size]\n\n", + "\n[br]", + "[br]\n", "\n[hr]", "[hr]\n", "\n[list", @@ -289,6 +291,8 @@ function html2bbcode($message) "\n[*]"), array( "[/size]\n", + "[br]", + "[br]", "[hr]", "[hr]", "[list", @@ -304,7 +308,7 @@ function html2bbcode($message) array('[b]', '[/b]', '[i]', '[/i]'), $message); // Restore linebreaks from temp tag - $message = preg_replace('/\[br\]\s{1}|\[br\]/', "\n", $message); + $message = preg_replace('/\[br\]\s?/', "\n", $message); // Handling Yahoo style of mails // $message = str_replace('[hr][b]From:[/b]', '[quote][b]From:[/b]', $message); |