From bb50b1788d4d25d549a38d85c02d2de5f23bf1cb Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Thu, 28 Jan 2021 13:36:14 -0400 Subject: don't do transformMultiline calls early these expect to have access to the full data array, so they shouldn't be executed until render time! this also makes the output data more consistent. --- upd8.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/upd8.js b/upd8.js index 1f12fa7..94cb436 100644 --- a/upd8.js +++ b/upd8.js @@ -934,9 +934,6 @@ async function processNewsDataFile(file) { let bodyShort = body.split('
')[0]; - body = transformMultiline(body); - bodyShort = transformMultiline(bodyShort); - return { name, body, @@ -1033,9 +1030,6 @@ async function processGroupDataFile(file) { let descriptionShort = description.split('
')[0]; - description = transformMultiline(description); - descriptionShort = transformMultiline(descriptionShort); - const urls = (getListField(section, 'URLs') || []).filter(Boolean); return { @@ -1784,7 +1778,7 @@ async function writeHomepage() { ${newsData.slice(0, 3).map((entry, i) => fixWS`

${entry.name}

- ${entry.bodyShort} + ${transformMultiline(entry.bodyShort)} ${entry.bodyShort !== entry.body && `(View rest of entry!)`}
`).join('\n')} @@ -1875,7 +1869,7 @@ function writeMiscellaneousPages() { ${newsData.map(entry => fixWS`

${getDateString(entry)} - ${entry.name}

- ${entry.body} + ${transformMultiline(entry.body)}
`).join('\n')} @@ -3586,7 +3580,7 @@ function generateSidebarRightForAlbum(album, currentTrack = null) { return {group, next, previous}; }).map(({group, next, previous}) => fixWS`

${group.name}

- ${!currentTrack && group.descriptionShort} + ${!currentTrack && transformMultiline(group.descriptionShort)} ${group.urls.length && `

Visit on ${joinNoOxford(group.urls.map(fancifyURL), 'or')}.

`} ${!currentTrack && fixWS` ${next && ``} -- cgit 1.3.0-6-gf8a5