File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,10 @@ def image(
7070 str: HTML fragment
7171 """
7272 alt = alt or ""
73+ if abssrc :
74+ img_path = abssrc
75+ else :
76+ img_path = f"https://dltj.org/assets/images/{ localsrc } "
7377 output : str = "<figure "
7478 if fig_class :
7579 output += f'class="{ fig_class } " '
@@ -78,16 +82,21 @@ def image(
7882 if width :
7983 output += f'style="width:{ width } px" '
8084 output += ">"
81- if ahref or localhref :
82- output = f'<a href="{ ahref } { localhref } ">'
85+ if ahref :
86+ output = f'<a href="{ ahref } ">'
87+ elif localhref :
88+ output = f'<a href="{ localhref } ">'
89+ output += "<picture>"
90+ if picclass :
91+ output += f'<source class="{ picclass } " src="{ img_path } "></source>'
8392 output += "<img "
8493 if width :
8594 output += f'width="{ width } " '
86- if abssrc :
87- output += f'src="{ abssrc } " '
88- else :
89- output += f'src="https://dltj.org/assets/images/{ localsrc } " '
95+ if imgclass :
96+ output += f'class="{ imgclass } " '
97+ output += f'src="{ img_path } " '
9098 output += f'alt="{ alt } ">'
99+ output += "</picture>"
91100 if ahref or localhref :
92101 output += "</a>"
93102 if caption :
You can’t perform that action at this time.
0 commit comments