From 527ff4e6d156bee95d39ac26aa49fc7733921a9a Mon Sep 17 00:00:00 2001 From: kai_ogita Date: Fri, 19 Feb 2021 02:25:38 +0900 Subject: [PATCH] Add url length validation to Link at inline-tool. (#1476) * Add url length validation to Link at inline-tool. fix * simplify, add chengelog Co-authored-by: Peter Savchenko --- docs/CHANGELOG.md | 1 + src/components/inline-tools/inline-tool-link.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 68a6ae38..99e15eff 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -10,6 +10,7 @@ - `Fix` - Fix BlockManager.setCurrentBlockByChildNode() with multiple Editor.js instances [#1503](https://github.com/codex-team/editor.js/issues/1503). - `Fix` - Fix an unstable block cut process [#1489](https://github.com/codex-team/editor.js/issues/1489). - `Fix` - Type definition of the Sanitizer config: the sanitize function now contains param definition [#1491](https://github.com/codex-team/editor.js/pull/1491). +- `Fix` - Fix unexpected behavior on an empty link pasting [#1348](https://github.com/codex-team/editor.js/issues/1348). ### 2.19.1 diff --git a/src/components/inline-tools/inline-tool-link.ts b/src/components/inline-tools/inline-tool-link.ts index 5e99bb99..b55120bb 100644 --- a/src/components/inline-tools/inline-tool-link.ts +++ b/src/components/inline-tools/inline-tool-link.ts @@ -291,6 +291,8 @@ export default class LinkInlineTool implements InlineTool { this.unlink(); event.preventDefault(); this.closeActions(); + + return; } if (!this.validateURL(value)) {