From 3755d19417e394c1b826d53f05850a29bfa152ae Mon Sep 17 00:00:00 2001 From: "@gapmiss" Date: Thu, 25 Jun 2026 16:37:38 -0500 Subject: [PATCH] fix: render inline callout labels containing square brackets in Live Preview The Live Preview decorator used `[^\]]*` for the label, which stops at the first `]`. A multi-part label like `[!!mail|test [with brackets]|var(...)]` broke as soon as it hit the `]` after "brackets", so the closing ]` no longer matched and the callout stayed as raw code. Reading mode was unaffected because its post-processor checks startsWith/endsWith. Switch the class to `[^`]+` so it matches up to the bounding backtick, consistent with the post-processor and cursor-detection regexes. Co-authored-by: Thierry VUILLEMIN <6804067+vuillemint@users.noreply.github.com> Co-Authored-By: Claude Opus 4.7 --- src/views/editor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/editor.ts b/src/views/editor.ts index 324daa9..e18d6a1 100644 --- a/src/views/editor.ts +++ b/src/views/editor.ts @@ -5,7 +5,7 @@ import { ViewPlugin, WidgetType, EditorView, ViewUpdate, Decoration, DecorationS import { RangeSetBuilder } from "@codemirror/state"; import { InlineCallout } from '../callout/builder'; -const REGEXP = /(`\[!!([^\]]*)\]`)/gm; +const REGEXP = /(`\[!!([^`]+)\]`)/gm; export const viewPlugin = ViewPlugin.fromClass(class { decorations: DecorationSet;