aboutsummaryrefslogtreecommitdiff
path: root/src/app
diff options
context:
space:
mode:
Diffstat (limited to 'src/app')
-rw-r--r--src/app/launcher.js39
1 files changed, 16 insertions, 23 deletions
diff --git a/src/app/launcher.js b/src/app/launcher.js
index 7b49dc4..ed6a513 100644
--- a/src/app/launcher.js
+++ b/src/app/launcher.js
@@ -19,40 +19,33 @@ function page(page) {
bgHolder.setAttribute("bg", page);
}; page(1)
-
-// Updates the Viper release notes
-ipcRenderer.on("vp-notes", (event, response) => {
+function formatRelease(notes) {
let content = "";
- for (const release of response) {
+ for (let release of notes) {
if (release.prerelease) {continue}
-
- content += "# " + release.name + "\n\n"
- + release.body.replaceAll("\r\n", "\n") + "\n\n\n";
+ content += "# " + release.name + "\n\n" + release.body + "\n\n\n";
}
- vpReleaseNotes.innerHTML = markdown(content);
-});
-
-async function loadVpReleases() {
- ipcRenderer.send("get-vp-notes");
-}; loadVpReleases();
+ return markdown(content, {
+ breaks: true
+ });
+}
+// Updates the Viper release notes
+ipcRenderer.on("vp-notes", (event, response) => {
+ vpReleaseNotes.innerHTML = formatRelease(response);
+});
// Updates the Northstar release notes
ipcRenderer.on("ns-notes", (event, response) => {
- let content = "";
-
- for (let release of response) {
- if (release.prerelease) {continue}
-
- content += "# " + release.name + "\n\n"
- + release.body.replaceAll("\r\n", "\nhtmlbreak") + "\n\n\n";
- }
-
- nsRelease.innerHTML = markdown(content).replaceAll("htmlbreak", "<br>");
+ nsRelease.innerHTML = formatRelease(response);
});
+async function loadVpReleases() {
+ ipcRenderer.send("get-vp-notes");
+}; loadVpReleases();
+
async function loadNsReleases() {
ipcRenderer.send("get-ns-notes");
}; loadNsReleases();