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': {
|
||||
const selectedText = window.getSelection().toString();
|
||||
const text = selectedText || window.prompt('Link text');
|
||||
if (!text) break;
|
||||
const url = window.prompt('Link URL');
|
||||
if (!url) break;
|
||||
document.execCommand('insertText', false, `[${text}](${url})`);
|
||||
const text = selectedText || 'Text';
|
||||
document.execCommand('insertText', false, `[${text}](Link)`);
|
||||
break;
|
||||
}
|
||||
case 'removeFormat':
|
||||
|
||||
Reference in New Issue
Block a user