From b9455d67120c18c8233ab8251d11a60d89504c0a Mon Sep 17 00:00:00 2001 From: blorbb <88137137+blorbb@users.noreply.github.com> Date: Tue, 23 Jan 2024 21:12:04 +1100 Subject: [PATCH] allow 0 or 1 space after `>` for callout suggestion --- src/suggest.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/suggest.ts b/src/suggest.ts index 21199b8..a9bca72 100644 --- a/src/suggest.ts +++ b/src/suggest.ts @@ -136,7 +136,8 @@ export class CalloutSuggest extends BracketSuggest { constructor(app: App, plugin: Plugin, csv: string) { super(app, plugin, { suggestions: csv.split(",").map((str) => str.trim()), - triggerRegex: /^\s*> \[!(\w*)$/, + // allow 0/1 space before the `[!` - https://github.com/blorbb/obsidian-blockier/issues/5 + triggerRegex: /^\s*> ?\[!(\w*)$/, suggestionClass: "blockier-callout-suggestion", renderMarkdown: (suggestion) => `> [!${suggestion}]`, });