Hyperlink credited users in the downloads page (#347)

* Regex add in hyperlinked authors

* Make the regex lazy

So it doesn't get greedy and try to match from the first parenthesis to the very last.
This commit is contained in:
Soitora 2020-09-15 09:30:21 +02:00 committed by GitHub
parent 3ea9745d4d
commit 3e4515c460
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,7 +24,10 @@ export default {
async mounted() {
try {
const { data } = await this.$store.dispatch("getStableReleaseData");
this.$data.whatsNew = marked(data.body);
this.$data.whatsNew = marked(data.body).replace(
/\(@(.*?)\)/g,
"(<a href='https://github.com/$1' target='_blank' rel='noopener'>@$1</a>)"
);
} catch (e) {
console.error(e);
}