mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
handle formatting from google docs
This commit is contained in:
parent
e2d7e5a8d7
commit
4fda2358b0
1 changed files with 7 additions and 0 deletions
|
@ -396,6 +396,9 @@ allowedTagsExtended["FONT"] = {"attrs": ["COLOR"]};
|
|||
const allowedStyling = {
|
||||
'color': true,
|
||||
'background-color': true,
|
||||
'font-weight': true,
|
||||
'font-style': true,
|
||||
'text-decoration-line': true,
|
||||
};
|
||||
|
||||
var filterExternalSpan = function(node) {
|
||||
|
@ -418,6 +421,10 @@ var filterExternalSpan = function(node) {
|
|||
if (!allowedStyling.hasOwnProperty(name)) {
|
||||
toRemove.push(name);
|
||||
}
|
||||
if (name === 'background-color' && node.style[name] === "transparent") {
|
||||
// google docs adds this unnecessarily
|
||||
toRemove.push(name);
|
||||
}
|
||||
}
|
||||
for (let name of toRemove) {
|
||||
node.style.removeProperty(name);
|
||||
|
|
Loading…
Reference in a new issue