1 2 3 | @register.filter
def highlight(text, word):
return mark_safe(text.replace(word, "<span class='highlight'>%s</span>" % word))
|
More like this
- Readonly fields on Form/Modelform by Killarny 4 years, 2 months ago
- Tags & filters for rendering search results by exogen 5 years, 1 month ago
- Code syntax highlighting templatetag by badrunner 5 years, 8 months ago
- DRY menu Custom Template Tag by sergzach 1 year, 1 month ago
- Git Revision Template Tag by sbaechler 6 months, 1 week ago
Comments