From: Hypolite Petovan Date: Sun, 19 May 2019 12:45:54 +0000 (-0400) Subject: Improve Diaspora raw text support in /babel module X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=325ba20141dfa4a85411cf24ea692ea0174cf5b2;p=friendica.git Improve Diaspora raw text support in /babel module --- diff --git a/src/Module/Debug/Babel.php b/src/Module/Debug/Babel.php index 899c8033c4..1ce1ac4c6e 100644 --- a/src/Module/Debug/Babel.php +++ b/src/Module/Debug/Babel.php @@ -7,6 +7,7 @@ use Friendica\Content\Text; use Friendica\Core\L10n; use Friendica\Core\Renderer; use Friendica\Model\Item; +use Friendica\Util\XML; /** * Translates input text into different formats (HTML, BBCode, Markdown) @@ -98,10 +99,10 @@ class Babel extends BaseModule $markdown = trim($_REQUEST['text']); $results[] = [ 'title' => L10n::t('Source input (Diaspora format)'), - 'content' => '
' . $markdown . '
' + 'content' => '
' . htmlspecialchars($markdown) . '
' ]; - $html = Text\Markdown::convert($markdown); + $html = Text\Markdown::convert(html_entity_decode($markdown,ENT_COMPAT, 'UTF-8')); $results[] = [ 'title' => L10n::t('Markdown::convert (raw HTML)'), 'content' => visible_whitespace(htmlspecialchars($html)) @@ -112,7 +113,7 @@ class Babel extends BaseModule 'content' => $html ]; - $bbcode = Text\Markdown::toBBCode($markdown); + $bbcode = Text\Markdown::toBBCode(XML::unescape($markdown)); $results[] = [ 'title' => L10n::t('Markdown::toBBCode'), 'content' => '
' . $bbcode . '
'