Skip to content

Commit

Permalink
Use soft_str in do_wordcount, to trigger undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
sivel committed Feb 27, 2020
1 parent 2a70ef2 commit df6c38f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/jinja2/filters.py
Expand Up @@ -761,7 +761,7 @@ def do_wordwrap(

def do_wordcount(s):
"""Count the words in that string."""
return len(_word_re.findall(s))
return len(_word_re.findall(soft_unicode(s)))


def do_int(value, default=0, base=10):
Expand Down

0 comments on commit df6c38f

Please sign in to comment.