add 404 error
This commit is contained in:
@ -1,11 +1,10 @@
|
||||
todo:
|
||||
|
||||
|
||||
☐ add message in status bar @notGoodIdea
|
||||
|
||||
☐ add **custom css** feature
|
||||
☐ sync scroll
|
||||
☐ sync scroll @needsUpdate
|
||||
☐ load images from internet (`https:`)
|
||||
☐ regive focus to the right markdown view
|
||||
☐ set the title of the preview
|
||||
☐ disable previewing when the preview is closed
|
||||
☐ preview.set_scratch(True)
|
||||
☐ add 404 image
|
||||
|
||||
@ -34,6 +34,9 @@ def get_content_till(string, char_to_look_for, start=0):
|
||||
return string[start:i], i
|
||||
|
||||
def to_base64(path):
|
||||
if not os.path.exists(path):
|
||||
return to_base64(os.path.join(os.path.dirname(__file__), '404.png'))
|
||||
|
||||
with open(path, 'rb') as fp:
|
||||
content = fp.read()
|
||||
return base64.standard_b64encode(content)
|
||||
|
||||
Reference in New Issue
Block a user