diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js index 19a5cc2c..42a1f3d4 100644 --- a/ext/bg/js/options.js +++ b/ext/bg/js/options.js @@ -380,13 +380,13 @@ class OptionsUtil { if (addition === null) { addition = await this._fetchAsset(additionSourceUrl); } - profileOptions.anki.fieldTemplates = await this._addFieldTemplatesBeforeEnd(fieldTemplates, addition); + profileOptions.anki.fieldTemplates = this._addFieldTemplatesBeforeEnd(fieldTemplates, addition); } } } - async _addFieldTemplatesBeforeEnd(fieldTemplates, addition) { - const pattern = /[ \t]*\{\{~?>\s*\(\s*lookup\s*\.\s*"marker"\s*\)\s*~?\}\}/; + _addFieldTemplatesBeforeEnd(fieldTemplates, addition) { + const pattern = /[ \t]*\{\{~?>\s*\(\s*lookup\s*\.\s*"marker"\s*\)\s*~?\}\}/g; const newline = '\n'; let replaced = false; fieldTemplates = fieldTemplates.replace(pattern, (g0) => {