#11910: More flexible urlize template filter (passing a function that will execute for each url) --------------------------------+------------------------------------------- Reporter: Stefan_Petrea | Owner: nobody Status: new | Milestone: Component: Template system | Version: 1.1 Keywords: template customize | Stage: Unreviewed Has_patch: 0 | --------------------------------+------------------------------------------- Hi,
I'd like to have more control over how the links are generated through the urlize built-in filter. To be more specific , I'd like to be able to pass a lambda or a subroutine(sorry I don't know how you call it in Python) so that it will be called for each link it detects on that particular text and let me modify it how I want. Of course, I cannot do that from the template Language , so what I propose is a urlize Factory that will let the user build his own customized urlize filter. new_filter = build_urlize_filter(do_when_url_encountered) and pass to do_when_url_encountered the url each time one is encountered so that the user can write his own code on what he thinks is right to be done here (My particular needs would be to get the text from the last '/' to the end of the link and use that as the text for the link) Best regards, Stefan -- Ticket URL: <http://code.djangoproject.com/ticket/11910> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---