djangosnippets.org: Latest snippets tagged with 'linebreaks'https://djangosnippets.org/tags/linebreaks/2008-04-11T14:11:58.933027-05:00Auto HTML Linebreak filter
2008-04-11T14:11:58.933027-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 table …</p>
Freely redistributablelinebreaksli template filter
2007-06-20T07:47:01.970275-05:00rokclimb15https://djangosnippets.org/snippets/291/<p>This template filter will split a string of text on newlines and return a string of <li></li>s with a newline before every line.</p>
<p>This is handy for taking a paragraph of text and making an <ol> or <ul> from its lines.</p>
<p>Don't forget to register your filter with the template …</p>
Freely redistributable