We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cf821d7 commit 9bccc4eCopy full SHA for 9bccc4e
packages/core/src/renderer/renderer-impl.ts
@@ -169,6 +169,13 @@ export function initRenderer(opts: IOpts): RendererAPI {
169
}
170
171
function addFootnote(title: string, link: string): number {
172
+ // 检查是否已经存在相同的链接
173
+ const existingFootnote = footnotes.find(([, , existingLink]) => existingLink === link)
174
+ if (existingFootnote) {
175
+ return existingFootnote[0] // 返回已存在的脚注索引
176
+ }
177
+
178
+ // 如果不存在,创建新的脚注
179
footnotes.push([++footnoteIndex, title, link])
180
return footnoteIndex
181
0 commit comments