class WordFinder extends WordQuiz {
+ namehtml(name) {
+ //let wbr = new RegExp('\w{4} [^aoeuiyc\W] [rl]?+ \K (?= [^aoeuiy\W] [rl]? [aoeuiy] \w)', 'g');
+ 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(ref => {
const [title, level, imgid, subs] = this.data[ref];
put(figitem, 'img[src=$]', `/data/word/32/${imgid}.jpg`);
}
if (title) {
- let html = title.replace(/\/(.*)/, ' <small>($1)</small>');
put(figitem, 'figcaption', {
- innerHTML: html,
+ innerHTML: this.namehtml(title),
});
}
if (level <= 1 && subs.length >= 2) {