mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 19:56:47 +03:00
If pasting a url atop another url, don't wrap one in the other (#8642)
This commit is contained in:
parent
f427f09b8b
commit
65e27cd6be
1 changed files with 2 additions and 1 deletions
|
@ -354,7 +354,8 @@ export default class BasicMessageEditor extends React.Component<IProps, IState>
|
|||
this.modifiedFlag = true;
|
||||
const range = getRangeForSelection(this.editorRef.current, model, document.getSelection());
|
||||
|
||||
if (plainText && range.length > 0 && linkify.test(plainText)) {
|
||||
// If the user is pasting a link, and has a range selected which is not a link, wrap the range with the link
|
||||
if (plainText && range.length > 0 && linkify.test(plainText) && !linkify.test(range.text)) {
|
||||
formatRangeAsLink(range, plainText);
|
||||
} else {
|
||||
replaceRangeAndMoveCaret(range, parts);
|
||||
|
|
Loading…
Reference in a new issue