UNPKG
atitor
Version:
latest (0.1.1)
0.1.1
0.1.0
♏ 一款现代化 Markdown 编辑器
b3log.org/vditor
Vanessa219/vditor
atitor
/
src
/
ts
/
util
/
getSelectText.ts
9 lines
(7 loc)
•
223 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
import
{selectIsEditor}
from
"./selection"
;
export
const
getSelectText
= (
editor: HTMLElement, range?: Range
) => {
if
(
selectIsEditor
(editor, range)) {
return
getSelection
().
toString
(); }
return
""
; };