summaryrefslogtreecommitdiff
path: root/ext/bg/js/template-renderer-frame-main.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-01-12 22:47:07 -0500
committerGitHub <noreply@github.com>2021-01-12 22:47:07 -0500
commit5ae3acf6ff4d68379d9ea73c6ec90b8dfa69c6ad (patch)
treebb5ef5fd289b8f2fff8f4d276e432082bbf2bfe4 /ext/bg/js/template-renderer-frame-main.js
parentb7c9fa105764eb2cd5befea86c98fe49f5763a1d (diff)
Anki note data abstraction (#1228)
* Create AnkiNoteData * Create AnkiNoteDataDefinitionProxyHandler * Update media injection * Create AnkiNoteDataDefinitionSecondaryProperties * Update note context format * Expose url and cloze on definition * Simplify for understandability * Remove unused _createNoteData * Update public object * Remove trims on sentence, since it should already be trimmed * Fix unused global
Diffstat (limited to 'ext/bg/js/template-renderer-frame-main.js')
-rw-r--r--ext/bg/js/template-renderer-frame-main.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/ext/bg/js/template-renderer-frame-main.js b/ext/bg/js/template-renderer-frame-main.js
index 92a8095e..d25eb56d 100644
--- a/ext/bg/js/template-renderer-frame-main.js
+++ b/ext/bg/js/template-renderer-frame-main.js
@@ -16,6 +16,7 @@
*/
/* globals
+ * AnkiNoteData
* JapaneseUtil
* TemplateRenderer
* TemplateRendererFrameApi
@@ -25,10 +26,7 @@
const japaneseUtil = new JapaneseUtil(null);
const templateRenderer = new TemplateRenderer(japaneseUtil);
templateRenderer.registerDataType('ankiNote', {
- modifier: ({data, marker}) => {
- data.marker = marker;
- return data;
- }
+ modifier: ({data, marker}) => new AnkiNoteData(data, marker).createPublic()
});
const api = new TemplateRendererFrameApi(templateRenderer);
api.prepare();