add versioning code for people broken by last update

This commit is contained in:
Alex Yatskov 2017-01-28 18:14:07 -08:00
parent 2398b990af
commit bf9925ec9c

View File

@ -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);
}
];