feat: make URLs in messages become links
Some checks failed
ci/woodpecker/push/build-and-publish Pipeline failed

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

View file

@ -28,7 +28,10 @@
</div> </div>
<div class="message-data"> <div class="message-data">
<div class="message-text"> <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> </div>
</div> </div>