Skip to content

Commit

Permalink
add term tags to {{tags}}
Browse files Browse the repository at this point in the history
  • Loading branch information
khaitruong922 committed Oct 6, 2024
1 parent 519ffc4 commit 79688e1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ext/js/templates/anki-template-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,11 @@ export class AnkiTemplateRenderer {
*/
_mergeTags(args) {
const [object, isGroupMode, isMergeMode] = /** @type {[object: import('anki-templates').TermDictionaryEntry, isGroupMode: boolean, isMergeMode: boolean]} */ (args);
/** @type {import('anki-templates').Tag[][]} */
const tagSources = [];
if (Array.isArray(object.termTags)) {
tagSources.push(object.termTags);
}
if (isGroupMode || isMergeMode) {
const {definitions} = object;
if (Array.isArray(definitions)) {
Expand All @@ -294,7 +298,9 @@ export class AnkiTemplateRenderer {
}
}
} else {
tagSources.push(object.definitionTags);
if (Array.isArray(object.definitionTags)) {
tagSources.push(object.definitionTags);
}
}

const tags = new Set();
Expand Down

0 comments on commit 79688e1

Please sign in to comment.