Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #40 from runejuhl/fix-truncatewords

Have truncatewords/2 ignore tuples (e.g. timestamp) and truncatewords/3 ...
  • Loading branch information...
commit 2f8504aaf9a811e3dc652e1e24537ab8fead31dd 2 parents 8552440 + 31788d1
@evanmiller evanmiller authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  src/erlydtl_filters.erl
View
2  src/erlydtl_filters.erl
@@ -1041,6 +1041,8 @@ truncatechars(_Input, 0, Acc) ->
truncatechars([C|Rest], CharsLeft, Acc) ->
truncatechars(Rest, CharsLeft - 1, [C|Acc]).
+truncatewords(Value, _WordsLeft, _Acc) when is_atom(Value) ->
+ Value;
truncatewords([], _WordsLeft, Acc) ->
lists:reverse(Acc);
truncatewords(_Input, 0, Acc) ->
Please sign in to comment.
Something went wrong with that request. Please try again.