]> git.mxchange.org Git - friendica.git/blobdiff - mod/babel.php
Merge pull request #6261 from annando/fix-magic
[friendica.git] / mod / babel.php
index e5ae96be70489556dd683a3ce3340b469d7a6b6b..b9846e4fb433a16867f7d6afd20bedff2cbd0aac 100644 (file)
@@ -5,6 +5,7 @@
 
 use Friendica\Content\Text;
 use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
 
 function visible_whitespace($s)
 {
@@ -114,6 +115,17 @@ function babel_content()
                                        'content' => visible_whitespace($bbcode)
                                ];
 
+                               $html2 = Text\BBCode::convert($bbcode);
+                               $results[] = [
+                                       'title' => L10n::t('HTML::toBBCode => BBCode::convert'),
+                                       'content' => $html2
+                               ];
+
+                               $results[] = [
+                                       'title' => L10n::t('HTML::toBBCode => BBCode::convert (raw HTML)'),
+                                       'content' => htmlspecialchars($html2)
+                               ];
+
                                $markdown = Text\HTML::toMarkdown($html);
                                $results[] = [
                                        'title' => L10n::t('HTML::toMarkdown'),
@@ -128,8 +140,8 @@ function babel_content()
                }
        }
 
-       $tpl = get_markup_template('babel.tpl');
-       $o = replace_macros($tpl, [
+       $tpl = Renderer::getMarkupTemplate('babel.tpl');
+       $o = Renderer::replaceMacros($tpl, [
                '$text'          => ['text', L10n::t('Source text'), htmlentities(defaults($_REQUEST, 'text', '')), ''],
                '$type_bbcode'   => ['type', L10n::t('BBCode'), 'bbcode', '', defaults($_REQUEST, 'type', 'bbcode') == 'bbcode'],
                '$type_markdown' => ['type', L10n::t('Markdown'), 'markdown', '', defaults($_REQUEST, 'type', 'bbcode') == 'markdown'],