Truncate function in the latest Jinja2 works differently from prior versions. We need a patch here to globally set truncate leeway to 0. Ref: https://github.com/pallets/jinja/issues/699 Ref: https://github.com/pallets/jinja/blob/master/jinja2/filters.py#L516