diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-07-09 20:14:05 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-09 20:14:05 -0400 |
commit | 7a1570885e7310e5b1e15ab798c9eb66694a96fb (patch) | |
tree | b44ee8498a55a0ab3866e0bd67600283d6fbae29 /ext/js/data/anki-note-builder.js | |
parent | 22f048e527552cf0451ea03e0e9bd869b6ad240b (diff) |
Simplify get media structure (#1817)
* Remove format argument of getMedia
* Implement escaping
Diffstat (limited to 'ext/js/data/anki-note-builder.js')
-rw-r--r-- | ext/js/data/anki-note-builder.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/ext/js/data/anki-note-builder.js b/ext/js/data/anki-note-builder.js index 02aa7969..621816d4 100644 --- a/ext/js/data/anki-note-builder.js +++ b/ext/js/data/anki-note-builder.js @@ -362,14 +362,14 @@ class AnkiNoteBuilder { (dictionaryMedia[dictionary]) : (dictionaryMedia[dictionary] = {}) ); - dictionaryMedia2[path] = {fileName}; + dictionaryMedia2[path] = {value: fileName}; } const media = { - audio: (typeof audioFileName === 'string' ? {fileName: audioFileName} : null), - screenshot: (typeof screenshotFileName === 'string' ? {fileName: screenshotFileName} : null), - clipboardImage: (typeof clipboardImageFileName === 'string' ? {fileName: clipboardImageFileName} : null), - clipboardText: (typeof clipboardText === 'string' ? {text: clipboardText} : null), - selectionText: (typeof selectionText === 'string' ? {text: selectionText} : null), + audio: (typeof audioFileName === 'string' ? {value: audioFileName} : null), + screenshot: (typeof screenshotFileName === 'string' ? {value: screenshotFileName} : null), + clipboardImage: (typeof clipboardImageFileName === 'string' ? {value: clipboardImageFileName} : null), + clipboardText: (typeof clipboardText === 'string' ? {value: clipboardText} : null), + selectionText: (typeof selectionText === 'string' ? {value: selectionText} : null), textFurigana, dictionaryMedia }; @@ -391,8 +391,8 @@ class AnkiNoteBuilder { break; } if (data !== null) { - const html = this._createFuriganaHtml(data, readingMode); - results.push({text, readingMode, details: {html}}); + const value = this._createFuriganaHtml(data, readingMode); + results.push({text, readingMode, details: {value}}); } } return results; |