On 4/10/2013 9:44am, Mike Dewhirst wrote:
> On 4/10/2013 12:21am, Bill Freeman wrote:
>> You can certainly write a custom filter. And if you do that, you can
>> divvy up your value into footnote links and other, and escape the other
>> parts yourself, returning the result as a safe string.
>
> So you mean I detect any non-footnote html in the custom filter myself
> and convert it to Klingon but add my own html for footnotes and flag all
> such fields as safe?
>
> Hadn't thought of that. Might investigate calling the Django safe filter
> from within the custom filter ...
>
> Great idea, thanks
And Django is fantastic too :)
All I need to do is ...
from django.utils.safestring import mark_safe
and return mark_safe(value_with_footnote_href) within my custom filter.
... which means I don't have to use the |safe filter and which makes me
much happier.
Cheers
Mike