export class TFile { constructor( public path: string, public extension = "md", ) {} } export class TFolder { constructor(public path: string) {} } export const notices: string[] = []; export class Notice { constructor(message: string) { notices.push(message); } hide(): void {} } export class Plugin {} export class ItemView {} export class PluginSettingTab {} export class Setting {} export class Component {} export const moment = () => undefined; function escapeHtml(value: string): string { return value .replace(/&/g, "&") .replace(//g, ">"); } export const MarkdownRenderer = { async render( _app: unknown, markdown: string, el: HTMLElement, _sourcePath: string, _component: unknown, ): Promise { const html = escapeHtml(markdown) .replace( /!?\[\[([^\]|]+)(?:\|([^\]]+))?\]\]/g, (_full, target: string, alias?: string) => `${alias ?? target}`, ) .replace(/\*\*([^*]+)\*\*/g, "$1") .replace( /(^|\s)(https?:\/\/[^\s]+)/g, (_full, lead: string, url: string) => `${lead}${url}`, ); el.innerHTML = `

${html}

`; }, };