From 7fc6a696338afd1cb797d95375af95398cc1b20a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Hennequin?= Date: Fri, 20 Sep 2024 16:14:33 +0200 Subject: [PATCH] refactor: improve get content for anchors --- src/list.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/list.ts b/src/list.ts index 9887a53..1864cd3 100644 --- a/src/list.ts +++ b/src/list.ts @@ -41,10 +41,7 @@ export function getContent(node: TNode): Nullable result += serialize( node.children[index]!, {decodeEntities: true} - ).replace( - /\r\n|\n/gu, - ' ' - ).replace(/\p{Zs}+/gu, ' ').replace(/^\p{Zs}+|\p{Zs}+$/gu, ''); + ).replace(/^\p{Zs}+|\p{Zs}+$/gu, ''); if (node.children[index + 1]) { result += ' '; }