Skip to content
Snippets Groups Projects
Commit e7947354 authored by Nicolas Bouilleaud's avatar Nicolas Bouilleaud
Browse files

Fix smarty_function_markdown_to_text() to use $locale

parent 1f05d88c
No related branches found
No related tags found
No related merge requests found
......@@ -90,7 +90,7 @@ function smarty_modifier_html($html) {
*/
function smarty_function_markdown_to_text($options, Smarty_Internal_Template $template)
{
$locale = \o80\i18n\I18N::instance()->getLoadedLang();
global $locale;
$text = strip_tags(Parsedown::instance()->text($options['markdown']));
$number_letters = (new NumberFormatter($locale, NumberFormatter::ORDINAL))->format($options['id'] + 1);
return $text !== '' ? $text : __f('Poll results', '%s option', $number_letters);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment