Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(lexical-core): make unknown-mention regex specific to <m-tags> not just <tags> (#1426)

Seamusbc72dfb0cea3
diff --git a/js/app/packages/lexical-core/transformers/unknownMention.ts b/js/app/packages/lexical-core/transformers/unknownMention.ts
index 069800b660..7a39b505d8 100644
--- a/js/app/packages/lexical-core/transformers/unknownMention.ts
+++ b/js/app/packages/lexical-core/transformers/unknownMention.ts
@@ -11,10 +11,11 @@ import {
export const UNKNOWN_MENTION: TextMatchTransformer = {
dependencies: [UnknownMentionNode],
type: 'text-match',
- // Match any XML tag that starts with 'm-' or other prefixes we don't recognize
+ // Match only XML tags that start with 'm-' prefix (e.g., <m-something>...</m-something>)
+ // Plain XML tags like <whatever> should be treated as visible text
// This should be registered AFTER all known transformers to act as a fallback
- regExp: /<([a-zA-Z0-9_-]+)>(.*?)<\/\1>/s,
- importRegExp: /<([a-zA-Z0-9_-]+)>(.*?)<\/\1>/s,
+ regExp: /<(m-[a-zA-Z0-9_-]+)>(.*?)<\/\1>/s,
+ importRegExp: /<(m-[a-zA-Z0-9_-]+)>(.*?)<\/\1>/s,
export: (node: LexicalNode) => {
if (!$isUnknownMentionNode(node)) return null;