aboutsummaryrefslogtreecommitdiff
path: root/editor/editor.ts
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor.ts')
-rw-r--r--editor/editor.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/editor/editor.ts b/editor/editor.ts
index b428e87..880ef93 100644
--- a/editor/editor.ts
+++ b/editor/editor.ts
@@ -307,6 +307,15 @@ class EditorLine {
return ed.onKeydownText(x, this.elText, ev)
}
+ this.elText.addEventListener("paste", (ev: ClipboardEvent) => {
+ if (!ev.clipboardData) {
+ return
+ }
+ ev.preventDefault()
+ const text = ev.clipboardData.getData("text/plain")
+ document.execCommand("insertHTML", false, text)
+ })
+
this.el.appendChild(this.elNumber)
this.el.appendChild(this.elText)
}