From bf9925ec9cabd5a755152aa89df1f87e38d53534 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sat, 28 Jan 2017 18:14:07 -0800 Subject: add versioning code for people broken by last update --- ext/bg/js/options.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js index f1f6c9a1..ca2792c0 100644 --- a/ext/bg/js/options.js +++ b/ext/bg/js/options.js @@ -119,6 +119,23 @@ function optionsVersion(options) { dictionary.enabled = dictionary.enableTerms || dictionary.enableKanji; dictionary.priority = 0; } + }, + () => { + const fixupFields = fields => { + const fixups = { + '{expression-furigana}': '{furigana}', + '{glossary-list}': '{glossary}' + }; + + for (const name in fields) { + for (const fixup in fixups) { + fields[name] = fields[name].replace(fixup, fixups[fixup]); + } + } + }; + + fixupFields(options.anki.terms.fields); + fixupFields(options.anki.kanji.fields); } ]; -- cgit v1.2.3