diff options
Diffstat (limited to 'ext/bg')
-rw-r--r-- | ext/bg/js/dictionary.js | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/ext/bg/js/dictionary.js b/ext/bg/js/dictionary.js index 6870601e..4645189d 100644 --- a/ext/bg/js/dictionary.js +++ b/ext/bg/js/dictionary.js @@ -41,7 +41,8 @@ class Dictionary { results = results.concat( indices.map(index => { const [e, r, t, ...g] = dict.defs[index]; - return {id: index, expression: e, reading: r, glossary: g, tags: t.split(' ')}; + const tags = Dictionary.fixupTags(t.split(' ')); + return {id: index, expression: e, reading: r, glossary: g, tags: tags}; }) ); } @@ -62,4 +63,19 @@ class Dictionary { return results; } + + static fixupTags(tags) { + const results = []; + for (const tag of tags) { + if (tag.startsWith('v5') && tag !== 'v5') { + results.push('v5'); + } else if (tag.startsWith('vs-')) { + results.push('vs'); + } + + results.push(tag); + } + + return results; + } } |