From 5590c98e4082e7434e1bb690bbbc2b5de7e0a888 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 24 May 2008 17:35:54 -0700 Subject: [PATCH] html2lrf: skip links that point to remote resources --- src/calibre/ebooks/lrf/html/convert_from.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/lrf/html/convert_from.py b/src/calibre/ebooks/lrf/html/convert_from.py index adfa7b37eb..fe572a963a 100644 --- a/src/calibre/ebooks/lrf/html/convert_from.py +++ b/src/calibre/ebooks/lrf/html/convert_from.py @@ -1423,7 +1423,8 @@ class HTMLConverter(object, LoggingInterface): if tagname in ["title", "script", "meta", 'del', 'frameset']: pass elif tagname == 'a' and self.link_levels >= 0: - if tag.has_key('href') and not self.link_exclude.match(tag['href']): + if tag.has_key('href') and not self.link_exclude.match(tag['href'])\ + and urlparse(tag['href'])[0] in ('', 'file'): path = munge_paths(self.target_prefix, tag['href'])[0] ext = os.path.splitext(path)[1] if ext: ext = ext[1:].lower()