djangosnippets.org: Latest snippets tagged with 'custom-filter'https://djangosnippets.org/tags/custom-filter/2009-04-12T02:37:14-05:00wordbreak filter2009-04-12T02:37:14-05:00soniiichttps://djangosnippets.org/snippets/1432/<p>usage:</p>
<p>{{ object.content|wordbreak:"10" }}</p>
<p>This means if any word is 10 characters or longer, a <code>&amp;shy;</code> will be placed every 10 characters. This is to break long words which may break the appearance of a page.</p>
<p>The output of this is HTML safe as the content has been conditionally ...</p>
Freely redistributableAuto HTML Linebreak filter2008-04-11T14:11:58-05:00punteneyhttps://djangosnippets.org/snippets/700/<p>This custom filter is helpful if you want to convert plain text to include html line breaks but you aren't sure if the text is actually plain text or if it already contains html line breaks.</p>
<p>First the filter looks for if the text contains any br, p, or ...</p>
Freely redistributable