Permalink
Browse files

URL-encode the file path before calling the 'open_url' command.

Otherwise some errors may occur if the file path contains spaces or special characters.
  • Loading branch information...
1 parent 5fb9177 commit 19295f68d63ab814d329d25305c35eea4182b709 @pdaether pdaether committed Apr 14, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 MarkdownBuild.py
View
@@ -3,7 +3,7 @@
import markdown_python
import os
import tempfile
-
+import urllib
class MarkdownBuild(sublime_plugin.WindowCommand):
def run(self):
@@ -26,4 +26,4 @@ def run(self):
output = tempfile.NamedTemporaryFile(delete=False, suffix='.html')
output.write(html.encode('UTF-8'))
output.close()
- self.window.run_command('open_url', {"url": "file://" + output.name})
+ self.window.run_command('open_url', {"url": "file://" + urllib.quote(output.name)})

0 comments on commit 19295f6

Please sign in to comment.