From aa8ef88b1f07b15a5a0136113ef5949d37702534 Mon Sep 17 00:00:00 2001 From: Tomas Rimkus Date: Wed, 2 Oct 2024 15:33:56 +0200 Subject: [PATCH 1/2] feat: keyboard shortcut for adding links --- projects/editor/extensions/link/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/editor/extensions/link/index.ts b/projects/editor/extensions/link/index.ts index b2b4bb902..ace0990df 100644 --- a/projects/editor/extensions/link/index.ts +++ b/projects/editor/extensions/link/index.ts @@ -29,11 +29,11 @@ function getCurrentWordBounds(editor: Editor): Range { ); const wordBefore = textBefore - .replaceAll(/\uFFFC/, '') + .replaceAll(/\uFFFC/g, '') .split(/\b/) .pop(); const wordAfter = textAfter - .replaceAll(/\uFFFC/, '') + .replaceAll(/\uFFFC/g, '') .split(/\b/) .shift(); From 3ad94ebe7a271207b63038d96c015eebaa6ee5c7 Mon Sep 17 00:00:00 2001 From: taiga-family-bot Date: Wed, 2 Oct 2024 13:35:23 +0000 Subject: [PATCH 2/2] chore: apply changes after linting [bot] --- projects/editor/extensions/link/index.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/projects/editor/extensions/link/index.ts b/projects/editor/extensions/link/index.ts index ace0990df..ef327249d 100644 --- a/projects/editor/extensions/link/index.ts +++ b/projects/editor/extensions/link/index.ts @@ -28,14 +28,8 @@ function getCurrentWordBounds(editor: Editor): Range { '\uFFFC', ); - const wordBefore = textBefore - .replaceAll(/\uFFFC/g, '') - .split(/\b/) - .pop(); - const wordAfter = textAfter - .replaceAll(/\uFFFC/g, '') - .split(/\b/) - .shift(); + const wordBefore = textBefore.replaceAll('', '').split(/\b/).pop(); + const wordAfter = textAfter.replaceAll('', '').split(/\b/).shift(); const from = pos - (wordBefore?.length ?? 0); const to = pos + (wordAfter?.length ?? 0);