Fix quotes breaking field descriptions, and prevent content injection
https://forums.ankiweb.net/t/some-field-descriptions-are-not-showing/26295
This commit is contained in:
parent
df456e959d
commit
8131ea1908
@ -162,7 +162,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||
|
||||
let fieldDescriptions: string[] = [];
|
||||
export function setDescriptions(descriptions: string[]): void {
|
||||
fieldDescriptions = descriptions;
|
||||
fieldDescriptions = descriptions.map((d) =>
|
||||
d.replace(/\\/g, "").replace(/"/g, '\\"'),
|
||||
);
|
||||
}
|
||||
|
||||
let fonts: [string, number, boolean][] = [];
|
||||
|
Loading…
Reference in New Issue
Block a user