librelist archives

« back to archive

jinja2 filter to transform embeded url into anchor tag

jinja2 filter to transform embeded url into anchor tag

From:
Jay Baker
Date:
2012-08-18 @ 19:51
Hi Flask community,

A quick question here. I'm wondering if anyone has come across a good
jinja2 filter implementation to find a url in text (in a comment object for
example) and turn it into an anchor tag?

Thanks for any thoughts and apologies for being perhaps slightly off topic.

-- Jay

Re: [flask] jinja2 filter to transform embeded url into anchor tag

From:
Steven Kryskalla
Date:
2012-08-18 @ 20:29
On Sat, Aug 18, 2012 at 12:51 PM, Jay Baker <jbaker.work@gmail.com> wrote:
> Hi Flask community,
>
> A quick question here. I'm wondering if anyone has come across a good jinja2
> filter implementation to find a url in text (in a comment object for
> example) and turn it into an anchor tag?
>
> Thanks for any thoughts and apologies for being perhaps slightly off topic.

Have you seen urllize? It comes with jinja2:

http://jinja.pocoo.org/docs/templates/#urlize

-steve

Re: [flask] jinja2 filter to transform embeded url into anchor tag

From:
Jay Baker
Date:
2012-08-18 @ 23:05
Thanks Steven. I thought I knew them all ... that was exactly what I was
looking for.

I knew it was worth asking here. Thanks alot.



On Sat, Aug 18, 2012 at 3:29 PM, Steven Kryskalla <skryskalla@gmail.com>wrote:

> On Sat, Aug 18, 2012 at 12:51 PM, Jay Baker <jbaker.work@gmail.com> wrote:
> > Hi Flask community,
> >
> > A quick question here. I'm wondering if anyone has come across a good
> jinja2
> > filter implementation to find a url in text (in a comment object for
> > example) and turn it into an anchor tag?
> >
> > Thanks for any thoughts and apologies for being perhaps slightly off
> topic.
>
> Have you seen urllize? It comes with jinja2:
>
> http://jinja.pocoo.org/docs/templates/#urlize
>
> -steve
>

Re: [flask] jinja2 filter to transform embeded url into anchor tag

From:
pronoyc@gmail.com
Date:
2012-08-18 @ 20:22
>
> Hi Flask community,
>
> A quick question here. I'm wondering if anyone has come across a good
> jinja2 filter implementation to find a url in text (in a comment object for
> example) and turn it into an anchor tag?
>

Could you maybe give an example? I am unable to understand what you mean.

-- 
Regards,

Pronoy Chopra
http://blog.pronoy.in <http://www.pronoy.in/about>/
http://www.twitter.com/pronoyc