@@ -34,7 +34,7 @@ def __init__(self, image_link_re: str, md: markdown.core.Markdown, base_path: Pa
34
34
35
35
super ().__init__ (image_link_re , md )
36
36
37
- def handleMatch (self , m , data : str ) -> tuple : # type: ignore[no-untyped-def]
37
+ def handleMatch (self , m , data : str ) -> tuple : # type: ignore[no-untyped-def, override ]
38
38
image , start , index = super ().handleMatch (m , data )
39
39
40
40
if image is None or not image .get ("title" ):
@@ -43,7 +43,7 @@ def handleMatch(self, m, data: str) -> tuple: # type: ignore[no-untyped-def]
43
43
src = image .get ("src" )
44
44
caption = image .get ("title" )
45
45
46
- if src .startswith ("http" ):
46
+ if src is None or src .startswith ("http" ):
47
47
raise ValueError (
48
48
f"Image path { src } has been given. Only images "
49
49
"available on the file system can be added."
@@ -57,7 +57,7 @@ def handleMatch(self, m, data: str) -> tuple: # type: ignore[no-untyped-def]
57
57
url = WEBVIZ_ASSETS .add (image_path )
58
58
59
59
image_style = ""
60
- for style_prop in image .get ("alt" ).split ("," ):
60
+ for style_prop in image .get ("alt" , default = "" ).split ("," ):
61
61
prop , value = style_prop .split ("=" )
62
62
if prop == "width" :
63
63
image_style += f"width: { value } ;"
0 commit comments