From ecc5ae10e15a415f60e1c80de3624d01e99d2dfd Mon Sep 17 00:00:00 2001 From: Massimo Di Pierro Date: Thu, 3 May 2012 18:48:30 -0500 Subject: [PATCH] better gluon/contrib/autolinks.py (still not sure this is behavior I want) --- VERSION | 2 +- gluon/contrib/autolinks.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 0055c191..a73c7d74 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 1.99.7 (2012-05-03 17:55:38) dev +Version 1.99.7 (2012-05-03 18:48:09) dev diff --git a/gluon/contrib/autolinks.py b/gluon/contrib/autolinks.py index 33867596..2ceb4544 100644 --- a/gluon/contrib/autolinks.py +++ b/gluon/contrib/autolinks.py @@ -158,7 +158,7 @@ def expand_one(url,cdict): def expand_html(html,cdict=None): soup = BeautifulSoup(html) for txt in soup.findAll(text=True): - if txt.parent.name != 'a': + if not txt.parent.name in ('a','script','pre','code','embed','object','audio','video'): ntxt = regex_link.sub( lambda match: expand_one(match.group(0),cdict), txt) txt.replaceWith(BeautifulSoup(ntxt))