From dd09d68ef91758ea4a617d05adb341305a74f1e0 Mon Sep 17 00:00:00 2001 From: Chrstn67 Date: Fri, 20 Dec 2024 11:17:53 +0100 Subject: [PATCH] MAJ lien CSS --- main.js | 8 +++++--- manifest.json | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) 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",