mirror of https://github.com/FreeTubeApp/FreeTube
Format links and show title in the in-app changelog (#5045)
This commit is contained in:
parent
f462777a3b
commit
a9c9f10059
|
@ -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 })
|
||||
|
|
Loading…
Reference in New Issue