From 92e1f33ec228da5ca143552a339b491969e90564 Mon Sep 17 00:00:00 2001 From: Charlie Chao Date: Mon, 14 Oct 2024 22:27:39 -0700 Subject: [PATCH] Fix regex for footnote definition where it would capture up to the last bracket colon instead of only the first. --- src/tidyFootnotes.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tidyFootnotes.ts b/src/tidyFootnotes.ts index bc365d3..0c73140 100644 --- a/src/tidyFootnotes.ts +++ b/src/tidyFootnotes.ts @@ -1,7 +1,7 @@ import { Editor } from 'obsidian'; const reKey = /\[\^(.+?(?=\]))\]/gi; -const reDefinition = /\[\^(.+)\]\:/; +const reDefinition = /^\[\^([^\]]+)\]\:/; /** An existing footnote key or definition. */ interface Marker {