From 989f89fcf442cbdfb07445a904c0935d5f0c190d Mon Sep 17 00:00:00 2001 From: JSKitty Date: Sat, 7 Dec 2024 11:20:25 +0000 Subject: [PATCH] Highlight changelog feature titles --- assets/style/style.css | 4 ++++ scripts/changelog.js | 18 ++++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/assets/style/style.css b/assets/style/style.css index 220809070..a15c919e2 100644 --- a/assets/style/style.css +++ b/assets/style/style.css @@ -220,6 +220,10 @@ progress[value]::-moz-progress-bar { font-size: 15px; } +.changelog b { + color: #A77BFF; +} + .changelog p .dotSpan { padding-left: 7px; border-left-style: solid; diff --git a/scripts/changelog.js b/scripts/changelog.js index 07538e13b..bd48895bc 100644 --- a/scripts/changelog.js +++ b/scripts/changelog.js @@ -48,12 +48,22 @@ export function renderChangelog() { // `#` is a header, for titles like "New Features" or "Bug Fixes" strHTML += `

${sanitizeHTML(line)}

`; break; - case '-': + case '-': { // `-` is a list element, for each 'New Feature' or 'Bug Fix' to be listed with - strHTML += `

${sanitizeHTML( - line - )}

`; + const match = line.match(/^(.*?):/); + if (match) { + // Format as a highlighted Title + Content pair + const title = sanitizeHTML(match[1]); + const content = sanitizeHTML(line.slice(title.length + 1)); + strHTML += `

${title}:${content}

`; + } else { + // Otherwise, it's just a plaintext line + strHTML += `

${sanitizeHTML( + line + )}

`; + } break; + } default: // If no element was recognised, it's just a plaintext line strHTML += `

${sanitizeHTML(rawLine)}

`;