1 2 3 | @register.filter
def highlight(text, word):
return mark_safe(text.replace(word, "<span class='highlight'>%s</span>" % word))
|
More like this
- Humanize lists of strings in templates by ChipX86 4 years, 8 months ago
- Readonly fields on Form/Modelform by Killarny 2 years, 11 months ago
- Page numbers with ... like in Digg by Ciantic 2 years, 10 months ago
- Tags & filters for rendering search results by exogen 3 years, 10 months ago
- NewForms Readonly / Edit Pattern by FreddieP 4 years, 2 months ago
Comments