From 860b9fbf12315362d2c33864521c3f081fd66545 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Mon, 21 Nov 2022 20:05:27 -0400 Subject: use html.fragment instead of ternary most places --- src/page/album.js | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) (limited to 'src/page/album.js') diff --git a/src/page/album.js b/src/page/album.js index a92d9a0..1313bb3 100644 --- a/src/page/album.js +++ b/src/page/album.js @@ -290,10 +290,11 @@ export function write(album, {wikiData}) { link.albumAdditionalFile({album, file}), })), - ...album.commentary ? [ - html.tag('p', language.$('releaseInfo.artistCommentary')), - html.tag('blockquote', transformMultiline(album.commentary)), - ] : [], + ...html.fragment( + album.commentary && [ + html.tag('p', language.$('releaseInfo.artistCommentary')), + html.tag('blockquote', transformMultiline(album.commentary)), + ]), ], }, @@ -440,21 +441,22 @@ export function generateAlbumSidebar(album, currentTrack, { ), })), - ...isAlbumPage ? [ - next && - html.tag('p', - {class: 'group-chronology-link'}, - language.$('albumSidebar.groupBox.next', { - album: link.album(next), - })), + ...html.fragment( + isAlbumPage && [ + next && + html.tag('p', + {class: 'group-chronology-link'}, + language.$('albumSidebar.groupBox.next', { + album: link.album(next), + })), - previous && - html.tag('p', - {class: 'group-chronology-link'}, - language.$('albumSidebar.groupBox.previous', { - album: link.album(previous), - })), - ] : [], + previous && + html.tag('p', + {class: 'group-chronology-link'}, + language.$('albumSidebar.groupBox.previous', { + album: link.album(previous), + })), + ]), ]); if (groupParts.length) { -- cgit 1.3.0-6-gf8a5