Skip to content

Commit

Permalink
Allow LinkNode to be replaced by custom node, fix bug in #3367 (#3588)
Browse files Browse the repository at this point in the history
  • Loading branch information
NhanHo authored Dec 19, 2022
1 parent d6b9e6b commit b5dca91
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/lexical-link/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import type {

import {addClassNamesToElement} from '@lexical/utils';
import {
$applyNodeReplacement,
$getSelection,
$isElementNode,
$isRangeSelection,
Expand Down Expand Up @@ -249,7 +250,7 @@ export function $createLinkNode(
url: string,
attributes?: LinkAttributes,
): LinkNode {
return new LinkNode(url, attributes);
return $applyNodeReplacement(new LinkNode(url, attributes));
}

export function $isLinkNode(
Expand Down

2 comments on commit b5dca91

@vercel
Copy link

@vercel vercel bot commented on b5dca91 Dec 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

lexical – ./packages/lexical-website

lexical-fbopensource.vercel.app
lexical.dev
lexicaljs.com
lexical-git-main-fbopensource.vercel.app
www.lexical.dev
lexicaljs.org

@vercel
Copy link

@vercel vercel bot commented on b5dca91 Dec 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

lexical-playground – ./packages/lexical-playground

lexical-playground-git-main-fbopensource.vercel.app
playground.lexical.dev
lexical-playground-fbopensource.vercel.app
lexical-playground.vercel.app

Please sign in to comment.