diff --git a/main.js b/main.js index ff02baf..3ebca7b 100644 --- a/main.js +++ b/main.js @@ -3,7 +3,7 @@ const { Plugin } = require("obsidian"); module.exports = class MyPlugin extends Plugin { async onload() { // Charger les styles CSS depuis un fichier local - this.loadStyles(); + await this.loadStyles(); // Inscription d'un processeur de post-traitement de markdown this.registerMarkdownPostProcessor((element) => { @@ -12,8 +12,10 @@ module.exports = class MyPlugin extends Plugin { } // Fonction pour charger les styles CSS dynamiquement - loadStyles() { - const stylePath = `${this.manifest.dir}/styles.css`; // Obtenir le chemin relatif au fichier CSS + async loadStyles() { + const stylePath = this.app.vault.adapter.getResourcePath( + `${this.manifest.dir}/styles.css` + ); // Obtenir un chemin valide const link = document.createElement("link"); link.rel = "stylesheet"; link.href = stylePath; diff --git a/manifest.json b/manifest.json index 161a9a3..fe85ccb 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "wonderbox", "name": "WonderBox", - "version": "1.0.9", + "version": "1.0.10", "minAppVersion": "0.12.0", "description": "Create more relevant text sections your tips, top notes, warnings and more.", "author": "Christian Humbert",