0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2024-12-21 23:03:11 -05:00

Fix empty string on clipboard if plainTextOnly

If extractRangeToClipboard was called with a toPlainText fn and
plainTextOnly=true, and there was a selection that was not just inside
a single text node, it was not actually getting the text to add to the
clipboard.
This commit is contained in:
Neil Jenkins 2023-10-03 11:13:02 +11:00
parent 9f3e2610a6
commit cc32c7dd7e

View file

@ -91,10 +91,8 @@ const extractRangeToClipboard = (
}
}
// Get Text version of data
if (plainTextOnly) {
// Do nothing; we were copying plain text to start
} else if (toPlainText && html !== undefined) {
// Get Text version of data if converting from HTML
if (toPlainText && html !== undefined) {
text = toPlainText(html);
}