+ link() {
+ // Handle URLs
+ if (this.selection.text.startsWith("https://") || this.selection.text.startsWith("http://")) {
+ this.replaceSelection("[" + this.selection.text + "](" + this.selection.text + ")");
+ // Handle selected text
+ } else {
+ this.replaceSelection("[" + this.selection.text + "]()")
+ }
+ }
+