diff --git a/main.js b/main.js index fd6c9baa..54c32c99 100644 --- a/main.js +++ b/main.js @@ -23,6 +23,13 @@ const processData = (data) => { // Flat list of vocabulary items for autocomplete purposes if (child.vocabulary) { child.flatVocabulary = stringifyNestedVocabulary(child.vocabulary); + + // Convert to title case + for (const [i, val] of child.flatVocabulary.entries()) { + if (!val) continue; + child.flatVocabulary[i] = val.split(' ').map(x => + x.charAt(0).toUpperCase() + x.substr(1).toLowerCase()).join(' '); + } } } }