X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fbabel.php;h=3352366bd5a78279c3e21d2b069c48c89e796c61;hb=a54fea313ff93b43ae0c691df2a8cf9c8c363006;hp=442941ab8a1fc7ae1258db38030d1bdb3e159f43;hpb=71c1be820767572f0e7bc48af37cef08e09f582d;p=friendica.git diff --git a/mod/babel.php b/mod/babel.php index 442941ab8a..3352366bd5 100644 --- a/mod/babel.php +++ b/mod/babel.php @@ -15,7 +15,7 @@ function babel_content() { $results = []; if (!empty($_REQUEST['text'])) { - switch(defaults($_REQUEST, 'type', 'bbcode')) { + switch (defaults($_REQUEST, 'type', 'bbcode')) { case 'bbcode': $bbcode = trim($_REQUEST['text']); $results[] = [ @@ -23,9 +23,15 @@ function babel_content() 'content' => visible_lf($bbcode) ]; + $plain = Text\BBCode::toPlaintext($bbcode, false); + $results[] = [ + 'title' => L10n::t('BBCode::toPlaintext'), + 'content' => visible_lf($plain) + ]; + $html = Text\BBCode::convert($bbcode); $results[] = [ - 'title' => L10n::t("BBCode::convert \x28raw HTML\x28"), + 'title' => L10n::t("BBCode::convert \x28raw HTML\x29"), 'content' => htmlspecialchars($html) ]; @@ -105,12 +111,11 @@ function babel_content() $tpl = get_markup_template('babel.tpl'); $o = replace_macros($tpl, [ - '$text' => ['text', L10n::t('Source text'), defaults($_REQUEST, 'text', ''), ''], - '$type_bbcode' => ['type', L10n::t('BBCode') , 'bbcode' , '', defaults($_REQUEST, 'type', 'bbcode') == 'bbcode'], + '$text' => ['text', L10n::t('Source text'), 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'], - '$type_html' => ['type', L10n::t('HTML') , 'html' , '', defaults($_REQUEST, 'type', 'bbcode') == 'html'], - - '$results' => $results + '$type_html' => ['type', L10n::t('HTML'), 'html', '', defaults($_REQUEST, 'type', 'bbcode') == 'html'], + '$results' => $results ]); return $o;