diff options
| author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2022-05-16 22:20:53 -0400 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-16 22:20:53 -0400 | 
| commit | bd53f2bbfb5cd523318d54779e40ceea7ba68874 (patch) | |
| tree | f035a141c850e301ec667f747a225c1ba6069d94 /ext/js | |
| parent | 63d37c872b786abe9233d70b2eff0362582cbc3a (diff) | |
Update _getNodeNoteIds to return integer IDs (#2142)
Diffstat (limited to 'ext/js')
| -rw-r--r-- | ext/js/display/display-anki.js | 11 | 
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) { |