mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
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
1 changed files with 3 additions and 1 deletions
|
@ -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 a new issue