/* 文件:markdown/link.ts — 处理行内与外部链接的解析与转义规则。 */ import { Tokens, MarkedExtension } from "marked"; import { Extension } from "./extension"; export class LinkRenderer extends Extension { allLinks:string[] = []; async prepare() { this.allLinks = []; } async postprocess(html: string) { if (this.settings.linkStyle !== 'footnote' || this.allLinks.length == 0) { return html; } const links = this.allLinks.map((href, i) => { return `