summaryrefslogtreecommitdiff
path: root/ext/bg/js/dictionary.js
diff options
context:
space:
mode:
authorsiikamiika <siikamiika@users.noreply.github.com>2017-10-24 18:31:18 +0300
committersiikamiika <siikamiika@users.noreply.github.com>2017-10-24 18:31:18 +0300
commit27a56dc236d8f05508160c28d9115baad26453d2 (patch)
treef04a4b9ea7dbdaea366222015f335d6bf0538957 /ext/bg/js/dictionary.js
parent78442fff1a995632f2b315994f2540459ee20eca (diff)
expand tags before dictTermsMergeByGloss
Diffstat (limited to 'ext/bg/js/dictionary.js')
-rw-r--r--ext/bg/js/dictionary.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/ext/bg/js/dictionary.js b/ext/bg/js/dictionary.js
index 50932735..fea5f3e5 100644
--- a/ext/bg/js/dictionary.js
+++ b/ext/bg/js/dictionary.js
@@ -229,7 +229,7 @@ function dictTermsMergeByGloss(result, definitions, appendTo, mergedIndices) {
definitionsByGloss[gloss] = {
expression: new Set(),
reading: new Set(),
- definitionTags: new Set(),
+ definitionTags: [],
glossary: definition.glossary,
source: result.source,
reasons: [],
@@ -254,10 +254,8 @@ function dictTermsMergeByGloss(result, definitions, appendTo, mergedIndices) {
}
for (const tag of definition.definitionTags) {
- if (typeof tag === 'string') {
- definitionsByGloss[gloss].definitionTags.add(tag);
- } else if (tag.category && tag.category !== 'dictionary') {
- definitionsByGloss[gloss].definitionTags.add(tag.name);
+ if (!definitionsByGloss[gloss].definitionTags.find(existingTag => existingTag.name === tag.name)) {
+ definitionsByGloss[gloss].definitionTags.push(tag);
}
}