[kupfer] text: Allow empty 'mailto:' as URL



commit 552891ffd5ce018adc52236a87cec381e32f876e
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Sun Sep 5 15:47:45 2010 +0200

    text: Allow empty 'mailto:' as URL
    
    Launchpad-bug: https://bugs.launchpad.net/kupfer/+bug/630489

 kupfer/plugin/core/text.py |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/kupfer/plugin/core/text.py b/kupfer/plugin/core/text.py
index 1030ab3..f246ece 100644
--- a/kupfer/plugin/core/text.py
+++ b/kupfer/plugin/core/text.py
@@ -110,12 +110,11 @@ class URLTextSource (TextSource):
 		domain = "".join(components[1:])
 
 		# If urlparse parses a scheme (http://), it's an URL
-		if len(domain.split()) == 1 and components[0]:
+		if len(domain.split()) <= 1 and components[0]:
 			url = text
 			name = ("".join(components[1:3])).strip("/")
-			name = try_unquote_url(name)
-			if name:
-				yield UrlLeaf(url, name=name)
+			name = try_unquote_url(name) or url
+			yield UrlLeaf(url, name=name)
 
 	def provides(self):
 		yield UrlLeaf



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]