1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-21 21:33:18 +01:00

fix: fix ansi link color + regex (#3440)

This commit is contained in:
Jérémy Touati
2024-12-08 19:44:43 +01:00
committed by GitHub
parent 327ae70428
commit c2e3879c1f
3 changed files with 23 additions and 21 deletions

View File

@@ -28,7 +28,14 @@ defineProps<{
}>();
const colorize = (value: string) => ansiConvertor.toHtml(value);
const urlPattern = /(https?:\/\/[^\s]+)/g;
const urlPattern =
/https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b[-a-zA-Z0-9()@:%_+.~#?&\/=]*/g;
const linkify = (text: string) =>
text.replace(urlPattern, (url) => `<a href="${url}" target="_blank" rel="noopener noreferrer">${url}</a>`);
</script>
<style scoped lang="postcss">
.log-wrapper :deep(a) {
@apply text-primary underline-offset-4 hover:underline;
}
</style>