Skip to content

Commit f4237b7

Browse files
committed
【修复,渲染】data_url 图片无法渲染
使 MD 文件中以 data_url 嵌入的图片能正常渲染。
1 parent d9e9965 commit f4237b7

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

index.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<html>
44
<markdown-html
5-
version="1.20.6"
5+
version="1.20.7"
66
author="PJ568"
77
repo="https://github.com/PJ-568/markdown.html"
88
license="CC BY-SA 4.0 International"
@@ -634,7 +634,12 @@
634634
images.forEach((img) => {
635635
const src = img.getAttribute("src");
636636
img.setAttribute("loading", "lazy");
637-
if (src && !isExternalLink(src) && isRelativePath(src)) {
637+
if (
638+
src &&
639+
!src.startsWith("data:") &&
640+
!isExternalLink(src) &&
641+
isRelativePath(src)
642+
) {
638643
var absolutePath = pValue
639644
? getDirectory(mdPath) + src
640645
: getPath() + src;

0 commit comments

Comments
 (0)