Remove textnode checks before applying firefox double double qutoes fix

This commit is contained in:
maver 2024-10-17 18:55:17 +00:00 committed by GitHub
parent f897a4ab1a
commit 82570ef31d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,8 +7,7 @@ function sanitizeInlineQuotationOnCopy() {
// To work around this, take the selection and transform <q> to <span> before calling toString().
document.addEventListener('copy', function (event) {
const selection = window.getSelection();
if (selection.anchorNode.nodeName !== '#text' || selection.focusNode.nodeName !== '#text' || !selection.anchorNode?.parentElement.closest('.mes_text')) {
// Complex selection, skip.
if (!selection.anchorNode?.parentElement.closest('.mes_text')) {
return;
}