@powerduck/md-editor 0.9.5 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -37,5 +37,6 @@ export declare class IncrementalRenderer {
37
37
  */
38
38
  private evictCacheIfNeeded;
39
39
  getBlockCount(): number;
40
+ private escapeHtml;
40
41
  destroy(): void;
41
42
  }
@@ -27,7 +27,9 @@ export interface MentionOptions {
27
27
  onMentionSearch?: (query: string) => MentionItem[] | Promise<MentionItem[]>;
28
28
  /**
29
29
  * Hook called when an item is selected. Return the text to insert at the
30
- * cursor (replacing the @query). If not provided, defaults to `@${item.label}`.
30
+ * cursor (replacing the @query). If not provided, defaults to
31
+ * `[@label](mention:id)` so the renderer can distinguish real mentions
32
+ * from plain @text in prose.
31
33
  */
32
34
  onMentionSelect?: (item: MentionItem) => string;
33
35
  /** Minimum query length before showing dropdown. Default: 0 (show on @). */
@@ -75,12 +77,11 @@ export declare class MentionController {
75
77
  destroy(): void;
76
78
  }
77
79
  /**
78
- * Render `@username` in the preview as a styled mention badge.
80
+ * Render `[@label](mention:user-id)` in the preview as a styled mention badge.
79
81
  *
80
- * - Matches @ followed by word chars / hyphens.
81
- * - Does NOT match email addresses (the char before @ must not be a word
82
- * char or dot, so "user@example.com" is left alone).
83
- * - Does not match inside code spans / code fences (markdown-it inline
84
- * rules naturally skip those).
82
+ * Uses the standard markdown link syntax with a `mention:` URI scheme so that
83
+ * plain `@text` in prose (e.g. "@media", "@deprecated", email addresses) is
84
+ * never mistaken for a mention. Only links whose href starts with `mention:`
85
+ * are converted to badges; all other links render normally.
85
86
  */
86
87
  export declare function useMentionRender(md: MarkdownIt): void;