Skip to content

Commit 8825e08

Browse files
committed
fix: changelog display
1 parent 4f0bcae commit 8825e08

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# UnderScript Changelog
22

3+
## Version 0.63.15 (2026-01-06)
4+
1. Fixed the changelog
5+
36
## Version 0.63.14 (2026-01-06)
47
Apparently UnderScript updates were broken and the past few releases didn't go through. Here's the changes:
58
1. Fixed filters not resetting to first page

src/base/underscript/changelog.js

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,25 @@ function open(message) {
5858
export async function get(version = 'latest', short = false) {
5959
const cache = version.includes('.');
6060
const key = `${version}${short ? '_short' : ''}`;
61-
if (cache && changelog[key]) return Promise.resolve(changelog[key]);
61+
if (changelog[key]) return changelog[key];
6262

63-
if (version === 'latest') {
64-
const { data } = await axios.get('https://raw.githubusercontent.com/UCProjects/UnderScript/refs/heads/master/changelog.md');
63+
function getHtml(text) {
64+
const parsedHTML = getMarkdown().makeHtml(text).replace(/\r?\n/g, '');
65+
// Cache results
66+
if (cache) changelog[key] = parsedHTML;
67+
return parsedHTML;
68+
}
6569

66-
return getMarkdown().makeHtml(data.substring(data.indexOf('##'))).replace(/\r?\n/g, '');
70+
if (short) {
71+
const { data: { body: text, name, published_at: published } } = await axios.get(`https://api.github.com/repos/UCProjects/UnderScript/releases/tags/${version}`);
72+
const date = luxon.DateTime.fromISO(published).toLocaleString(luxon.DateTime.DATE_MED);
73+
return getHtml(`## ${name} (${date})\n${text}`);
6774
}
6875

69-
const { data: { body: text, name, published_at: published } } = await axios.get(`https://api.github.com/repos/UCProjects/UnderScript/releases/tags/${version}}`);
70-
const date = luxon.DateTime.fromISO(published).toLocaleString(luxon.DateTime.DATE_MED);
71-
const parsedHTML = getMarkdown().makeHtml(`## ${name} (${date})\n${text}`).replace(/\r?\n/g, '');
72-
// Cache results
73-
if (cache) changelog[key] = parsedHTML;
74-
return parsedHTML;
76+
const { data } = await axios.get('https://raw.githubusercontent.com/UCProjects/UnderScript/refs/heads/master/changelog.md');
77+
const start = data.indexOf(`\n## ${cache ? `Version ${version}` : ''}`);
78+
if (!~start) throw new Error('Invalid Changelog');
79+
return getHtml(data.substring(start));
7580
}
7681

7782
export function load(version = 'latest', short = false) {

0 commit comments

Comments
 (0)