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(md): fix link auto-match bug (#3914)

Seamusccf1a1fb571a
diff --git a/js/app/packages/core/component/LexicalMarkdown/plugins/links/linksPlugin.ts b/js/app/packages/core/component/LexicalMarkdown/plugins/links/linksPlugin.ts
index ef723ef4bd..8e05064613 100644
--- a/js/app/packages/core/component/LexicalMarkdown/plugins/links/linksPlugin.ts
+++ b/js/app/packages/core/component/LexicalMarkdown/plugins/links/linksPlugin.ts
@@ -13,7 +13,7 @@ import {
$wrapNodeInElement,
mergeRegister,
} from '@lexical/utils';
-import { $createUnlinkedTextNode } from '@lexical-core';
+import { $createUnlinkedTextNode } from '@lexical-core/nodes/UnlinkedTextNode';
import type { LexicalEditor } from 'lexical';
import {
$createParagraphNode,
@@ -31,8 +31,6 @@ import {
TextNode,
} from 'lexical';
import linkify, { type Match } from 'linkify-it';
-import { createSignal } from 'solid-js';
-import { editorFocusSignal } from '../../utils';
const strictLinkifier = new linkify(undefined, {
fuzzyLink: false,
@@ -200,7 +198,6 @@ function $convertAutoLinkToLinkNode(node: AutoLinkNode): LinkNode {
const linkNode = $createLinkNode(url);
linkNode.append($createTextNode(text));
node.replace(linkNode);
- linkNode.selectEnd();
return linkNode;
}
@@ -344,8 +341,6 @@ function registerLinksPlugin(editor: LexicalEditor, props: LinkPluginProps) {
...props,
};
- const [_editorFocus, setEditorFocus] = createSignal(false);
-
let hoveredLink: ILinkInfo | undefined;
const handleClick = (e: MouseEvent) => {
@@ -398,8 +393,6 @@ function registerLinksPlugin(editor: LexicalEditor, props: LinkPluginProps) {
};
return mergeRegister(
- editorFocusSignal(editor, setEditorFocus),
-
editor.registerRootListener((root, prevRoot) => {
if (root) {
root.addEventListener('click', handleClick);