aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mixed')
-rw-r--r--ext/mixed/js/display-generator.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/mixed/js/display-generator.js b/ext/mixed/js/display-generator.js
index 37be5041..1921a454 100644
--- a/ext/mixed/js/display-generator.js
+++ b/ext/mixed/js/display-generator.js
@@ -76,8 +76,12 @@ class DisplayGenerator {
}
if (expressionContainer !== null) {
- const segments = [{text: details.expression, furigana: details.reading}]; // TODO : Use proper furigana segmentation
- DisplayGenerator._appendFurigana(expressionContainer, segments, this._appendKanjiLinks.bind(this));
+ let furiganaSegments = details.furiganaSegments;
+ if (!Array.isArray(furiganaSegments)) {
+ // This case should not occur
+ furiganaSegments = [{text: details.expression, furigana: details.reading}];
+ }
+ DisplayGenerator._appendFurigana(expressionContainer, furiganaSegments, this._appendKanjiLinks.bind(this));
}
DisplayGenerator._appendMultiple(tagContainer, this.createTag.bind(this), details.termTags);