UNPKG
@anypond/vditor
Version:
latest (3.11.4)
3.11.4
3.11.3
3.11.2
3.11.1
♏ 易于使用的 Markdown 编辑器,为适配不同的应用场景而生
b3log.org/vditor
anypond/vditor
@anypond/vditor
/
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
""
; };