Skip to content

Commit 6b0c186

Browse files
authored
Merge pull request #27 from emptylight370/main
修复:适配assets下嵌套文件夹
2 parents 390477e + 8cdadd3 commit 6b0c186

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
}
5353
}
5454

55-
html[data-theme-mode="dark"] img[src^="assets/drawio-"] {
55+
html[data-theme-mode="dark"] img[src^="assets/"][src*="/drawio-"] {
5656
filter: invert(0.8) brightness(1.2);
5757
}
5858

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export default class DrawioPlugin extends Plugin {
7070
const imageElement = blockElement.querySelector("img") as HTMLImageElement;
7171
if (imageElement) {
7272
const imageURL = imageElement.getAttribute("data-src");
73-
const imageURLRegex = /^assets\/drawio-.+\.(?:svg|png)$/;
73+
const imageURLRegex = /^assets\/(?:.+\/)?drawio-.+\.(?:svg|png)$/;
7474
if (!imageURLRegex.test(imageURL)) return;
7575
this.getDrawioImageInfo(imageURL, false).then((imageInfo) => {
7676
if (imageInfo) {

0 commit comments

Comments
 (0)