Use pipes.quote instead of a string.replace in the link plugin.
This commit is contained in:
parent
88d32a7bc4
commit
906c74f0be
1 changed files with 2 additions and 2 deletions
|
@ -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')
|
||||
|
|
Loading…
Reference in a new issue