mirror of
https://github.com/gapmiss/inline-callouts.git
synced 2026-07-22 05:45:12 +00:00
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 <noreply@anthropic.com>
This commit is contained in:
parent
858a209cbe
commit
3755d19417
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue