summaryrefslogtreecommitdiff
path: root/ext/js/display/display-anki.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/display/display-anki.js')
-rw-r--r--ext/js/display/display-anki.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/ext/js/display/display-anki.js b/ext/js/display/display-anki.js
index 78a06404..8cb9311e 100644
--- a/ext/js/display/display-anki.js
+++ b/ext/js/display/display-anki.js
@@ -668,7 +668,16 @@ class DisplayAnki {
_getNodeNoteIds(node) {
const {noteIds} = node.dataset;
- return typeof noteIds === 'string' && noteIds.length > 0 ? noteIds.split(' ') : [];
+ const results = [];
+ if (typeof noteIds === 'string' && noteIds.length > 0) {
+ for (const noteId of noteIds.split(' ')) {
+ const noteIdInt = Number.parseInt(noteId, 10);
+ if (Number.isFinite(noteIdInt)) {
+ results.push(noteIdInt);
+ }
+ }
+ }
+ return results;
}
_getViewNoteButton(index) {