mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 01:15:13 +00:00
This is an experiment at more intuitive rich-text support. We may need to revert or tweak if it causes serious issues. Basically support markdown AND bbcode simultaneously
in a way that attempts to preserve the unique source syntax of each when editing.
This commit is contained in:
parent
07fc840f41
commit
0cdc5f3781
1 changed files with 7 additions and 8 deletions
|
@ -3,6 +3,7 @@
|
|||
use Zotlabs\Lib\Apps;
|
||||
use Zotlabs\Lib\Libzot;
|
||||
use Zotlabs\Lib\SvgSanitizer;
|
||||
use Michelf\MarkdownExtra;
|
||||
|
||||
/**
|
||||
* @file include/bbcode.php
|
||||
|
@ -1248,17 +1249,15 @@ function bbcode($Text, $options = []) {
|
|||
|
||||
// Convert new line chars to html <br> tags
|
||||
|
||||
// nlbr seems to be hopelessly messed up
|
||||
// $Text = nl2br($Text);
|
||||
|
||||
// We'll emulate it.
|
||||
|
||||
$Text = str_replace("\r\n", "\n", $Text);
|
||||
$Text = str_replace(array("\r", "\n"), array('<br>', '<br>'), $Text);
|
||||
|
||||
if ($preserve_nl)
|
||||
$Text = str_replace(array("\n", "\r"), array('', ''), $Text);
|
||||
$Text = MarkdownExtra::DefaultTransform($Text);
|
||||
$Text = str_replace(">\n", '><br>', $Text);
|
||||
|
||||
//$Text = str_replace(array("\r", "\n"), array('<br>', '<br>'), $Text);
|
||||
|
||||
// if ($preserve_nl)
|
||||
// $Text = str_replace(array("\n", "\r"), array('', ''), $Text);
|
||||
|
||||
$Text = str_replace(array("\t", " "), array(" ", " "), $Text);
|
||||
|
||||
|
|
Loading…
Reference in a new issue