feat: make URLs in messages become links
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful

This commit is contained in:
SauceyRed 2025-06-01 23:09:37 +02:00
parent 6182e00dd9
commit 35852d8cad
Signed by: sauceyred
GPG key ID: 2BF92EB6D8A5CCA7

View file

@ -14,7 +14,10 @@
</span>
</div>
<div class="message-text">
{{ text }}
<template v-for="word of text.split(' ')">
<NuxtLink v-if="/^http(s|):\/\/(?:www\.)?[\w-]{1,}\.[A-Za-z]{2,}[\/?]{0,1}[\w-=&\/#.]*$/.test(word)" :href="word" :external="true" target="_blank">{{ word }}</NuxtLInk>
<template v-else>{{ ' ' + word + ' ' }}</template>
</template>
</div>
</div>
</div>
@ -28,7 +31,10 @@
</div>
<div class="message-data">
<div class="message-text">
{{ text }}
<template v-for="word of text.split(' ')">
<NuxtLink v-if="/^http(s|):\/\/(?:www\.)?[\w-]{1,}\.[A-Za-z]{2,}[\/?]{0,1}[\w-=&\/#.]*$/.test(word)" :href="word" :external="true" target="_blank">{{ word }}</NuxtLInk>
<template v-else>{{ word + ' ' }}</template>
</template>
</div>
</div>
</div>