Remove alpha channel from highlight color when inserting a note
Fixes #2499
This commit is contained in:
parent
dea9fc5e88
commit
bdbde99fa7
1 changed files with 13 additions and 0 deletions
|
@ -189,6 +189,19 @@ Zotero.Notes = new function() {
|
||||||
Zotero.logError(e);
|
Zotero.logError(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nodes = doc.querySelectorAll('span[style]');
|
||||||
|
for (let node of nodes) {
|
||||||
|
// Browser converts #RRGGBBAA hex color to rgba function, and we convert it to rgb function,
|
||||||
|
// because word processors don't understand colors with alpha channel
|
||||||
|
if (node.style.backgroundColor && node.style.backgroundColor.startsWith('rgba')) {
|
||||||
|
node.style.backgroundColor = node.style.backgroundColor
|
||||||
|
.replace('rgba', 'rgb')
|
||||||
|
.split(',')
|
||||||
|
.slice(0, 3)
|
||||||
|
.join(',') + ')';
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return doc.body.innerHTML;
|
return doc.body.innerHTML;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue