summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2012-07-30 23:46:51 +0200
committerFlorent Le Coz <louiz@louiz.org>2012-07-30 23:56:48 +0200
commit906c74f0bea7794ad4341b9f64ca7508e2394fff (patch)
tree8c41d5e35fb52034d40d555e24234f73ce8345c4
parent88d32a7bc4f8f97a488c313952103567038b1c32 (diff)
downloadpoezio-906c74f0bea7794ad4341b9f64ca7508e2394fff.tar.gz
poezio-906c74f0bea7794ad4341b9f64ca7508e2394fff.tar.bz2
poezio-906c74f0bea7794ad4341b9f64ca7508e2394fff.tar.xz
poezio-906c74f0bea7794ad4341b9f64ca7508e2394fff.zip
Use pipes.quote instead of a string.replace in the link plugin.
-rw-r--r--plugins/link.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/link.py b/plugins/link.py
index 29ded32f..8d757be6 100644
--- a/plugins/link.py
+++ b/plugins/link.py
@@ -7,6 +7,7 @@ from plugin import BasePlugin
from xhtml import clean_text
import common
import tabs
+import pipes
url_pattern = re.compile(r'\b(http[s]?://(?:\S+))\b', re.I|re.U)
@@ -41,8 +42,7 @@ class Plugin(BasePlugin):
nb = 1
link = self.find_link(nb)
if link:
- link = re.sub("'", "\\'", link)
- link = re.sub('"', '\\"', link)
+ link = pipes.quote(link)
self.core.exec_command("%s %s" % (self.config.get('browser', 'firefox'), link))
else:
self.core.information('No URL found.', 'Warning')