${element}
`; - } else if (element.type === 'a') { - return ` ${element.text} `; - } else if (element.type === 'video') { - return ``; - } else return ''; - }).join('\n'); - - const processTimeline = (timeline, {showMore}) => { - getElement(timelineId).innerHTML = timeline.map( - element => timelineElementToHTML(element, createId(), showMore) - ).join('\n'); - }; - - const timelineElementToHTML = ({date, title, picture, description, more, link}, id, showMore) => ` -${date}
` : ''} -${date}
` : ''} - ${picture ? `${description}
` : ''} - ${more ? ` -${element}
`; + } else if (element.type === "a") { + return ` ${element.text} `; + } else if (element.type === "video") { + return ``; + } else return ""; + }) + .join("\n"); + + const processTimeline = (timeline, { showMore }) => { + getElement(timelineId).innerHTML = timeline + .map(element => timelineElementToHTML(element, createId(), showMore)) + .join("\n"); + }; + + const timelineElementToHTML = ( + { date, title, picture, description, more, link }, + id, + showMore + ) => ` +${date}
` : ""} +${date}
` : ""} + ${ + picture + ? `${description}
` : ""} + ${ + more + ? ` +