Задать вопрос

Тел: +7 965 3737 888

418

Просмотров

0

Ответов

Enhanced "avoid widows" template filters

<p>Building on <a href="http://foothold.ru/knowledge/detail/avoid-widows-using-a-template-filter.html">jcroft's snippet</a>, here's a slightly more advanced version which has two filters, one for basic text and the other for html snippets.</p>
<p>Usage is like so:</p>
&lt;h2&gt;{{ blog_entry.headline|escape|widont }}&lt;/h2&gt;
{{ blog_entry.html|widont_html }}

<p>On top of Jeff's reasons for using these filters, they are important because they help keep one of <a href="http://www.ebible.com/bible/NIV/Exodus+22%3A22">God's commandments</a>. ;)</p>

Вопрос полезен? Да0/Нет0
file_5083.py(1.9Кб)
None