Description editor: insert link placeholder inline instead of prompting
Clicking Link no longer pops up "Link text"/"Link URL" dialogs; it inserts [Text](Link) (or [selectedText](Link)) directly so the placeholders can be edited in place.
This commit is contained in:
@@ -1864,11 +1864,8 @@ class GuideEditor {
|
|||||||
}
|
}
|
||||||
case 'createLink': {
|
case 'createLink': {
|
||||||
const selectedText = window.getSelection().toString();
|
const selectedText = window.getSelection().toString();
|
||||||
const text = selectedText || window.prompt('Link text');
|
const text = selectedText || 'Text';
|
||||||
if (!text) break;
|
document.execCommand('insertText', false, `[${text}](Link)`);
|
||||||
const url = window.prompt('Link URL');
|
|
||||||
if (!url) break;
|
|
||||||
document.execCommand('insertText', false, `[${text}](${url})`);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'removeFormat':
|
case 'removeFormat':
|
||||||
|
|||||||
Reference in New Issue
Block a user