use Friendica\Content\Text;
use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
function visible_whitespace($s)
{
'title' => L10n::t('BBCode::toMarkdown => Markdown::convert => HTML::toBBCode'),
'content' => visible_whitespace($bbcode4)
];
+
+ $item = [
+ 'body' => $bbcode,
+ 'tag' => '',
+ ];
+
+ \Friendica\Model\Item::setHashtags($item);
+ $results[] = [
+ 'title' => L10n::t('Item Body'),
+ 'content' => visible_whitespace($item['body'])
+ ];
+ $results[] = [
+ 'title' => L10n::t('Item Tags'),
+ 'content' => $item['tag']
+ ];
break;
case 'markdown':
$markdown = trim($_REQUEST['text']);
$html = Text\Markdown::convert($markdown);
$results[] = [
'title' => L10n::t('Markdown::convert (raw HTML)'),
- 'content' => htmlspecialchars($html)
+ 'content' => visible_whitespace(htmlspecialchars($html))
];
$results[] = [
}
}
- $tpl = get_markup_template('babel.tpl');
- $o = replace_macros($tpl, [
- '$text' => ['text', L10n::t('Source text'), htmlentities(defaults($_REQUEST, 'text', '')), ''],
+ $tpl = Renderer::getMarkupTemplate('babel.tpl');
+ $o = Renderer::replaceMacros($tpl, [
+ '$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'],