From 5dcc2315d242bcec29cc478618d448c941f73ab1 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sat, 14 May 2022 18:12:57 -0400 Subject: Structured content auto language (#2131) * Pass JapaneseUtil instance to StructuredContentGenerator * Move body of createStructuredContent to an internal function * Create _createStructuredContentGenericElement * Wrap structured content in a * Change _createStructuredContent to _appendStructuredContent * Add public appendStructuredContent function * Add missing return * Remove unused _createDocumentFragment * Automatically assign lang=ja for content with Japanese characters without an explicit language * Add test --- ext/js/templates/sandbox/anki-template-renderer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/js/templates') diff --git a/ext/js/templates/sandbox/anki-template-renderer.js b/ext/js/templates/sandbox/anki-template-renderer.js index c75f92d3..45dda06c 100644 --- a/ext/js/templates/sandbox/anki-template-renderer.js +++ b/ext/js/templates/sandbox/anki-template-renderer.js @@ -536,7 +536,7 @@ class AnkiTemplateRenderer { _createStructuredContentGenerator(data) { const contentManager = new AnkiTemplateRendererContentManager(this._mediaProvider, data); - const instance = new StructuredContentGenerator(contentManager, document); + const instance = new StructuredContentGenerator(contentManager, this._japaneseUtil, document); this._cleanupCallbacks.push(() => contentManager.unloadAll()); return instance; } -- cgit v1.2.3