word/finder: move html formatting into common method
[sheet.git] / word / quiz.js
index 5498809f67ceb2bbb0ce9a7d31ab8205217b6277..44703948f369b7cb09f4ad9c2b0466ef3b9a1b0f 100644 (file)
@@ -83,6 +83,15 @@ class Words {
                        get label() {
                                return row[0].replace(/\/.*/, ''); // primary form
                        },
+                       get html() {
+                               let aliases = this.title.split('/');
+                               let html = aliases.shift();
+                               html = html.replace(/\((.+)\)/, '<small>$1</small>');
+                               for (let alias of aliases) {
+                                       html += ` <small>(${alias})</small>`;
+                               }
+                               return html;
+                       },
                        level: row[1],
                        imgid: row[2],
                        thumb(size = 32) {