elias-sundqvist / obsidian-annotator

A plugin for reading and annotating PDFs and EPUBs in obsidian.
GNU Affero General Public License v3.0
1.42k stars 63 forks source link

Error: Plugin "obsidian-annotator" is not passing Component in renderMarkdown. #350

Closed Seraphli closed 5 months ago

Seraphli commented 7 months ago

This error appears in the console.

Error: Plugin "obsidian-annotator" is not passing Component in renderMarkdown. This is needed to avoid memory leaks when embedded contents register global event handlers.

BTW, obsidian new API marks renderMarkdown as deprecated.

/**
 * @public
 */
export abstract class MarkdownRenderer extends MarkdownRenderChild implements MarkdownPreviewEvents, HoverParent {
    /** @public */
    app: App;

    /** @public */
    hoverPopover: HoverPopover;

    /** @public */
    abstract get file(): TFile;

    /**
     * Renders markdown string to an HTML element.
     * @public
     * @deprecated - use {@link MarkdownRenderer.render}
     */
    static renderMarkdown(markdown: string, el: HTMLElement, sourcePath: string, component: Component): Promise<void>;
    /**
     * Renders markdown string to an HTML element.
     * @param app - A reference to the app object
     * @param markdown - The markdown source code
     * @param el - The element to append to
     * @param sourcePath - The normalized path of this markdown file, used to resolve relative internal links
     * @param component - A parent component to manage the lifecycle of the rendered child components.
     * @public
     */
    static render(app: App, markdown: string, el: HTMLElement, sourcePath: string, component: Component): Promise<void>;
}

You might need to replace it with render API.