UNPKG

vditor

Version:

♏ 易于使用的 Markdown 编辑器,为适配不同的应用场景而生

9 lines (7 loc) 223 B
import {selectIsEditor} from "./selection"; export const getSelectText = (editor: HTMLElement, range?: Range) => { if (selectIsEditor(editor, range)) { return getSelection().toString(); } return ""; };