mirror of
https://framagit.org/hubzilla/core.git
synced 2026-06-21 00:52:33 -04:00
Fix: Preserve hard linebreaks from markdown and html
This commit is contained in:
@@ -192,7 +192,8 @@ function html2bbcode($message)
|
||||
|
||||
node2bbcode($doc, 'blockquote', array(), '[quote]', '[/quote]');
|
||||
|
||||
node2bbcode($doc, 'br', array(), "\n", '');
|
||||
// Use a temporary tag to keep line breaks
|
||||
node2bbcode($doc, 'br', array(), '[br]', '');
|
||||
|
||||
node2bbcode($doc, 'p', array('class'=>'MsoNormal'), "\n", "");
|
||||
node2bbcode($doc, 'div', array('class'=>'MsoNormal'), "\r", "");
|
||||
@@ -302,6 +303,9 @@ function html2bbcode($message)
|
||||
$message = str_replace(array('[b][b]', '[/b][/b]', '[i][i]', '[/i][/i]'),
|
||||
array('[b]', '[/b]', '[i]', '[/i]'), $message);
|
||||
|
||||
// Restore linebreaks from temp tag
|
||||
$message = str_replace('[br] ', "\n", $message);
|
||||
|
||||
// Handling Yahoo style of mails
|
||||
// $message = str_replace('[hr][b]From:[/b]', '[quote][b]From:[/b]', $message);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user