エディタで選択中の文字列を取得する方法。`editor.getSelection()`を使う。 ```ts app.workspace.getActiveViewOfType(MarkdownView)?.editor?.getSelection() ?? null; ``` 型やNullを気にせずに最短で取得するなら以下。 ```ts app.workspace.activeLeaf.view.editor.getSelection() ```