Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
csdjk committed May 16, 2024
1 parent e5982b0 commit 5611ba9
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ export default class HtmlLocalImgPlugin extends Plugin {
async onload() {
await this.loadSettings();
console.log("Running on ---------------onload")


this.registerMarkdownPostProcessor((element, ctx) => {
this.processElement(element, ctx.sourcePath);
})



let activeFile = this.app.workspace.getActiveFile();
if (activeFile) {
this.registerEditorExtension(
Expand All @@ -71,8 +79,7 @@ export default class HtmlLocalImgPlugin extends Plugin {
}
for (const link of targetLinks) {
// console.log('link.src: ', link.src);

if ( link.src == "" || link.src.includes("https://")) {
if (link.src == "" || link.src.includes("https://")) {
continue;
}
let clean_link = link.src.replace('app://obsidian.md/', '')
Expand Down

0 comments on commit 5611ba9

Please sign in to comment.