With the new duplicate appearance, excluding the bg color becomes viable

https://forums.ankiweb.net/t/incorrect-text-formatting-copied/24060
This commit is contained in:
Damien Elmes 2022-10-24 09:24:48 +10:00
parent 22f54c2c01
commit 8b53b2210d
2 changed files with 7 additions and 4 deletions

View file

@ -35,9 +35,13 @@ describe("filterHTML", () => {
expect( expect(
filterHTML('<span style="background-color: blue;">x</span>', false, false), filterHTML('<span style="background-color: blue;">x</span>', false, false),
).toBe("x"); ).toBe("x");
// or if it's an internal paste // no filtering on internal paste
expect( expect(
filterHTML('<span style="background-color: blue;"></span>', true, true), filterHTML(
).toBe('<span style=""></span>'); '<span style="background-color: transparent;"></span>',
true,
true,
),
).toBe('<span style="background-color: transparent;"></span>');
}); });
}); });

View file

@ -44,7 +44,6 @@ export const filterStylingLightMode = filterStyling(discard, {
...nightModeExceptions, ...nightModeExceptions,
}); });
export const filterStylingInternal = filterStyling(keep, { export const filterStylingInternal = filterStyling(keep, {
"background-color": discard,
"font-size": discard, "font-size": discard,
"font-family": discard, "font-family": discard,
width: discard, width: discard,