Skip to content

Commit 906c74f

Browse files
committed
Use pipes.quote instead of a string.replace in the link plugin.
1 parent 88d32a7 commit 906c74f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugins/link.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from xhtml import clean_text
88
import common
99
import tabs
10+
import pipes
1011

1112
url_pattern = re.compile(r'\b(http[s]?://(?:\S+))\b', re.I|re.U)
1213

@@ -41,8 +42,7 @@ def command_link(self, args):
4142
nb = 1
4243
link = self.find_link(nb)
4344
if link:
44-
link = re.sub("'", "\\'", link)
45-
link = re.sub('"', '\\"', link)
45+
link = pipes.quote(link)
4646
self.core.exec_command("%s %s" % (self.config.get('browser', 'firefox'), link))
4747
else:
4848
self.core.information('No URL found.', 'Warning')

0 commit comments

Comments
 (0)