mirror of
https://github.com/facebook/lexical.git
synced 2025-05-17 06:59:17 +08:00
[lexical-markdown]: Bug fix: Do not export auto-link nodes (#7539)
Co-authored-by: Baptiste Jamin <baptiste@crisp.chat>
This commit is contained in:
@ -10,7 +10,12 @@ import type {ListType} from '@lexical/list';
|
|||||||
import type {HeadingTagType} from '@lexical/rich-text';
|
import type {HeadingTagType} from '@lexical/rich-text';
|
||||||
|
|
||||||
import {$createCodeNode, $isCodeNode, CodeNode} from '@lexical/code';
|
import {$createCodeNode, $isCodeNode, CodeNode} from '@lexical/code';
|
||||||
import {$createLinkNode, $isLinkNode, LinkNode} from '@lexical/link';
|
import {
|
||||||
|
$createLinkNode,
|
||||||
|
$isAutoLinkNode,
|
||||||
|
$isLinkNode,
|
||||||
|
LinkNode,
|
||||||
|
} from '@lexical/link';
|
||||||
import {
|
import {
|
||||||
$createListItemNode,
|
$createListItemNode,
|
||||||
$createListNode,
|
$createListNode,
|
||||||
@ -542,7 +547,7 @@ export const ITALIC_UNDERSCORE: TextFormatTransformer = {
|
|||||||
export const LINK: TextMatchTransformer = {
|
export const LINK: TextMatchTransformer = {
|
||||||
dependencies: [LinkNode],
|
dependencies: [LinkNode],
|
||||||
export: (node, exportChildren, exportFormat) => {
|
export: (node, exportChildren, exportFormat) => {
|
||||||
if (!$isLinkNode(node)) {
|
if (!$isLinkNode(node) || $isAutoLinkNode(node)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
const title = node.getTitle();
|
const title = node.getTitle();
|
||||||
|
Reference in New Issue
Block a user