Skip to content

Commit

Permalink
file prefix and img alternative syntax for revolunet#16
Browse files Browse the repository at this point in the history
  • Loading branch information
revolunet committed May 17, 2012
1 parent 7ea8155 commit 3b54144
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions MarkdownPreview.py
Expand Up @@ -44,16 +44,16 @@ def preprocess(self, contents):
RE_IMG = """
(
!\[([^\]]+)\] # alternative text
\( # source start
([^)']+) # image path
[\(\[] # source start
([^)'\]]+) # image path
(?:\s'([^']+)')? # optional title
\) # source end
[\)\]] # source end
)
"""
filename = self.view.file_name()
if filename:
# skip if file not saved
abs_path = '%s/' % os.path.dirname(filename)
abs_path = u'file://%s/' % os.path.dirname(filename)
for md, alt, src, title in re.findall(RE_IMG, contents, re.VERBOSE):
if src.startswith(('http', '/')):
# skip abdolute paths
Expand Down

0 comments on commit 3b54144

Please sign in to comment.