diff options
Diffstat (limited to 'ext/js/data/anki-note-builder.js')
-rw-r--r-- | ext/js/data/anki-note-builder.js | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/ext/js/data/anki-note-builder.js b/ext/js/data/anki-note-builder.js index 17bc1a5c..38588439 100644 --- a/ext/js/data/anki-note-builder.js +++ b/ext/js/data/anki-note-builder.js @@ -60,7 +60,7 @@ export class AnkiNoteBuilder { glossaryLayoutMode = 'default', compactTags = false, mediaOptions = null, - dictionaryStylesMap, + dictionaryStylesMap = new Map(), }) { let duplicateScopeDeckName = null; let duplicateScopeCheckChildren = false; @@ -173,6 +173,21 @@ export class AnkiNoteBuilder { return {type, term, reading}; } + /** + * @param {import('settings').DictionariesOptions} dictionaries + * @returns {Map<string, string>} + */ + getDictionaryStylesMap(dictionaries) { + const styleMap = new Map(); + for (const dictionary of dictionaries) { + const {name, styles} = dictionary; + if (typeof styles === 'string') { + styleMap.set(name, styles); + } + } + return styleMap; + } + // Private /** |