From 945e2a3c7671e14fe8a7becf9dd61c94feacf7b6 Mon Sep 17 00:00:00 2001 From: Robbie Antenesse Date: Sat, 6 Jul 2019 22:10:10 -0600 Subject: [PATCH] Display orthograpy translations in details --- src/js/render.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/js/render.js b/src/js/render.js index 8764a48..b0afd82 100644 --- a/src/js/render.js +++ b/src/js/render.js @@ -106,7 +106,18 @@ export function renderDetails() { ${phonotacticsNotesHTML}`; - const orthographyHTML = '

Orthography

Notes:

' + md(removeTags(orthography.notes)) + '
'; + const { translations } = orthography; + const translationsHTML = `

Translations

${translations.map(translation => { + translation = translation.split('=').map(value => value.trim()); + if (translation.length > 1 && translation[0] !== '' && translation[1] !== '') { + return `${translation[0]}${translation[1]}`; + } + return false; + }).filter(html => html !== false).join(' ')}
`; + const orthographyNotesHTML = '

Notes

' + md(removeTags(orthography.notes)) + '
'; + const orthographyHTML = `

Orthography

+ ${translations.length > 0 ? translationsHTML : ''} + ${orthographyNotesHTML}`; const grammarHTML = '

Grammar

Notes:

' + md(removeTags(grammar.notes)) + '
'; detailsPanel.innerHTML = generalHTML + phonologyHTML + phonotacticsHTML + orthographyHTML + grammarHTML;