diff --git a/src/modules/link-tooltip.coffee b/src/modules/link-tooltip.coffee index 8561f8cf48..4500436a2e 100644 --- a/src/modules/link-tooltip.coffee +++ b/src/modules/link-tooltip.coffee @@ -54,7 +54,12 @@ class LinkTooltip extends Tooltip saveLink: -> url = this._normalizeURL(@textbox.value) - @quill.formatText(@range, 'link', url, 'user') if @range? + if @range? + if @range.isCollapsed() + anchor = this._findAnchor(@range) + anchor.href = url if anchor? + else + @quill.formatText(@range, 'link', url, 'user') this.setMode(url, false) setMode: (url, edit = false) ->