djangosnippets.org: Latest snippets tagged with 'wordwrap'https://djangosnippets.org/tags/wordwrap/2012-09-20T16:37:39.563380-05:00Filter to add zero-width space to break up long words
2012-09-20T16:37:39.563380-05:00jayliewhttps://djangosnippets.org/snippets/2822/<p>If you have long words (no spaces) that are so long that it's messing up your design, add a 0-width space in the word every X chars.</p>
<p>Usage:</p>
<p>Step 1. Inside your app's directory, create dir called 'templatetags'. In that directory, create a .py file (say 'app_extras.py'). Make sure you …</p>
Freely redistributableWordWrap template tag
2007-03-26T08:27:23.935230-05:00Daeghttps://djangosnippets.org/snippets/134/<p>Basically a clone of the default "wrap" filter. I use it to generate plaintext e-mail that has to be broken at 75 characters.</p>
<p>{% wordwrap 80 %}
Some text here, including other template tags, includes, etc.
{% endwordwrap %}</p>
<p>I prefer this over the {% filter wordwrap:80 %} as my …</p>
Freely redistributable