summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-10-14 19:35:13 -0400
committerGitHub <noreply@github.com>2020-10-14 19:35:13 -0400
commita72c3d7719cafcbf0ccd17b24c8c7108743ef1a7 (patch)
tree6bc330552fd0d6019637455c49a5c66a26a67ed4 /ext
parent4ca6101273d84d8d095be254fe4ef0597888567a (diff)
Fix template updates for multiple declarations (#918)
* Update pattern to be multi-match * Remove unnecessary async
Diffstat (limited to 'ext')
-rw-r--r--ext/bg/js/options.js6
1 files changed, 3 insertions, 3 deletions
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) => {