Skip to content

Commit

Permalink
Format links and show title in the in-app changelog (FreeTubeApp#5045)
Browse files Browse the repository at this point in the history
  • Loading branch information
absidue committed May 14, 2024
1 parent f462777 commit a9c9f10
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/renderer/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,17 @@ export default defineComponent({
.then((json) => {
const tagName = json[0].tag_name
const versionNumber = tagName.replace('v', '').replace('-beta', '')
this.updateChangelog = marked.parse(json[0].body)

let changelog = json[0].body
// Link usernames to their GitHub profiles
.replaceAll(/@(\S+)\b/g, '[@$1](https://github.com/$1)')
// Shorten pull request links to #1234
.replaceAll(/https:\/\/github\.com\/FreeTubeApp\/FreeTube\/pull\/(\d+)/g, '[#$1]($&)')

// Add the title
changelog = `# ${json[0].name}\n${changelog}`

this.updateChangelog = marked.parse(changelog)
this.changeLogTitle = json[0].name

this.updateBannerMessage = this.$t('Version {versionNumber} is now available! Click for more details', { versionNumber })
Expand Down

0 comments on commit a9c9f10

Please sign in to comment.