summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-12-28 19:28:59 -0800
committerAlex Yatskov <alex@foosoft.net>2016-12-28 19:28:59 -0800
commit37d61b35d06d0c080cafb29e0e4ca9b2533e38a2 (patch)
tree627f83cd73f1152533182e36fa9b5eba122536a5 /ext
parentef24b4f236b863fe6b1491af804aeefa45c410f7 (diff)
fix glossary lists with one item
Diffstat (limited to 'ext')
-rw-r--r--ext/bg/js/yomichan.js12
-rw-r--r--ext/fg/css/frame.css8
2 files changed, 14 insertions, 6 deletions
diff --git a/ext/bg/js/yomichan.js b/ext/bg/js/yomichan.js
index e8956057..6cb7d415 100644
--- a/ext/bg/js/yomichan.js
+++ b/ext/bg/js/yomichan.js
@@ -161,11 +161,15 @@ class Yomichan {
break;
case 'glossary-list':
if (definition.glossary) {
- value = '<ol style="text-align: left;">';
- for (const gloss of definition.glossary) {
- value += `<li>${gloss}</li>`;
+ if (definition.glossary.length > 1) {
+ value = '<ol style="white-space: pre; text-align: left;">';
+ for (const gloss of definition.glossary) {
+ value += `<li>${gloss}</li>`;
+ }
+ value += '</ol>';
+ } else {
+ value = `<p style="white-space: pre;">${definition.glossary.join('')}</p>`;
}
- value += '</ol>';
}
break;
case 'tags':
diff --git a/ext/fg/css/frame.css b/ext/fg/css/frame.css
index d519d4b7..8b8172f7 100644
--- a/ext/fg/css/frame.css
+++ b/ext/fg/css/frame.css
@@ -114,7 +114,9 @@ body {
}
.term-glossary li span {
- color: #000;
+ color: #000;
+ overflow-x: auto;
+ white-space: pre;
}
.term-glossary p {
@@ -156,7 +158,9 @@ body {
}
.kanji-glossary li span {
- color: #000;
+ color: #000;
+ overflow-x: auto;
+ white-space: pre;
}
.kanji-glossary p {