git.shiar.nl
/
sheet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
word/finder: move html formatting into common method
[sheet.git]
/
word
/
finder.js
diff --git
a/word/finder.js
b/word/finder.js
index ed8905462a098fb43e4029dddb0d468baacd8284..3dca29b8711061be90d9cbe5193fbca7c8329c7e 100644
(file)
--- a/
word/finder.js
+++ b/
word/finder.js
@@
-1,14
+1,4
@@
class WordFinder extends WordQuiz {
class WordFinder extends WordQuiz {
- namehtml(name) {
- let aliases = name.split('/');
- let html = aliases.shift();
- html = html.replace(/\((.+)\)/, '<small>$1</small>');
- for (let alias of aliases) {
- html += ` <small>(${alias})</small>`;
- }
- return html;
- }
-
add(catitem, rows) {
rows.forEach(word => {
if (!word) return;
add(catitem, rows) {
rows.forEach(word => {
if (!word) return;
@@
-19,7
+9,7
@@
class WordFinder extends WordQuiz {
}
if (word.title) {
put(figitem, 'figcaption', {
}
if (word.title) {
put(figitem, 'figcaption', {
- innerHTML:
this.namehtml(word.title)
,
+ innerHTML:
word.html
,
});
}
if (this.preset.debug) {
});
}
if (this.preset.debug) {