snipt/utils/templatetags/truncate_lines.py

9 lines
149 B
Python
Raw Normal View History

from django import template
register = template.Library()
@register.filter
def truncate_lines(text):
2019-01-23 15:52:55 -08:00
return "\n".join(text.split("\n")[:300])