Skip to content

Commit

Permalink
Highlight changelog feature titles
Browse files Browse the repository at this point in the history
  • Loading branch information
JSKitty committed Dec 7, 2024
1 parent 6b0fd24 commit 989f89f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
4 changes: 4 additions & 0 deletions assets/style/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
18 changes: 14 additions & 4 deletions scripts/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,22 @@ export function renderChangelog() {
// `#` is a header, for titles like "New Features" or "Bug Fixes"
strHTML += `<h3>${sanitizeHTML(line)}</h3>`;
break;
case '-':
case '-': {
// `-` is a list element, for each 'New Feature' or 'Bug Fix' to be listed with
strHTML += `<p><span class="dotSpan"></span>${sanitizeHTML(
line
)}</p>`;
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 += `<p><span class="dotSpan"></span><b>${title}</b>:${content}</p>`;
} else {
// Otherwise, it's just a plaintext line
strHTML += `<p><span class="dotSpan"></span>${sanitizeHTML(
line
)}</p>`;
}
break;
}
default:
// If no element was recognised, it's just a plaintext line
strHTML += `<p>${sanitizeHTML(rawLine)}</p>`;
Expand Down

0 comments on commit 989f89f

Please sign in to comment.