diff --git a/rollup.config.js b/rollup.config.js index 0a93cb2..b62ee01 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,7 +1,7 @@ -import typescript from "@rollup/plugin-typescript"; -import { nodeResolve } from "@rollup/plugin-node-resolve"; -import commonjs from "@rollup/plugin-commonjs"; -import css from "rollup-plugin-css-only"; +const typescript = require ("@rollup/plugin-typescript"); +const { nodeResolve } = require ("@rollup/plugin-node-resolve"); +const commonjs = require("@rollup/plugin-commonjs"); +const css = require ("rollup-plugin-css-only"); const banner = `/* THIS IS A GENERATED/BUNDLED FILE BY ROLLUP @@ -9,7 +9,7 @@ if you want to view the source visit the plugins github repository */ `; -export default { +module.exports = { input: "./src/main.ts", output: { dir: ".", diff --git a/src/main.ts b/src/main.ts index 964001b..d9a9ff3 100644 --- a/src/main.ts +++ b/src/main.ts @@ -421,15 +421,16 @@ export default class ObsidianAdmonition } if (!TYPE_REGEX.test(el.textContent) && !push) return; - if ( - !( - Array.from(el.children).find((e) => - TYPE_REGEX.test(e.textContent) - ) instanceof HTMLParagraphElement - ) - ) - return; + if (!push) { + if ( + !( + Array.from(el.children).find((e) => + TYPE_REGEX.test(e.textContent) + ) instanceof HTMLParagraphElement + ) + ) + return; push = true; let child = new MarkdownRenderChild(el); id = getID(); @@ -653,6 +654,7 @@ title: this.app.workspace.layoutReady ? this.layoutReady() : this.app.workspace.on( + //@ts-expect-error "layout-ready", this.layoutReady.bind(this) ); @@ -667,6 +669,7 @@ title: this.app.workspace.layoutReady ? this.layoutReady() : this.app.workspace.on( + //@ts-expect-error "layout-ready", this.layoutReady.bind(this) );