Skip to content

Commit

Permalink
MDL-73332 mustache: Fix shortentext helper
Browse files Browse the repository at this point in the history
In the docs, it claims you can provide length to
the shortentext template helper as a context variable.
In reality, that is not the case.
  • Loading branch information
martygilbert committed Jul 14, 2022
1 parent c1910fc commit 4a27fe0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/classes/output/mustache_shorten_text_helper.php
Expand Up @@ -55,8 +55,9 @@ public function shorten($args, Mustache_LambdaHelper $helper) {
$length = trim($length);
$text = trim($text);

// Allow mustache tags in the text.
// Allow mustache tags in the length and text.
$text = $helper->render($text);
$length = $helper->render($length);

return shorten_text($text, $length);
}
Expand Down

0 comments on commit 4a27fe0

Please sign in to comment.