Skip to content

Commit b2328bb

Browse files
committed
Trim the text before checking if it's empty for a early return
1 parent f523251 commit b2328bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/paste-markdown-html.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ function onPaste(event: ClipboardEvent) {
2121
let text = transfer.getData('text/plain')
2222
const textHTML = transfer.getData('text/html')
2323
if (!textHTML) return
24-
if (!text) return
2524

2625
text = text.trim()
26+
if (!text) return
2727

2828
// Generate DOM tree from HTML string
2929
const parser = new DOMParser()

0 commit comments

Comments
 (0)