support loading files from resource #5

This commit is contained in:
Mathieu PATUREL
2017-01-06 19:06:47 +11:00
parent 057f770859
commit 613e3fb1b2
4 changed files with 10 additions and 4 deletions

View File

@ -6,7 +6,8 @@ import re
from .image_manager import ImageManager
def plugin_loaded():
global error404
global error404, loading
loading = sublime.load_resource('Packages/MarkdownLivePreview/loading.txt')
error404 = sublime.load_resource('Packages/MarkdownLivePreview/404.txt')
@ -25,7 +26,7 @@ def replace_img_src_base64(html):
if ''.join(path).startswith(tuple(get_settings().get('load_from_internet'
'_when_starts'))):
image = ImageManager.get(''.join(path))
image = image or to_base64('loading.png')
image = image or loading
else:
# local image