Update transformer.ts

Gitlab icons
(i hope there exists mdi:gitlab)
This commit is contained in:
Godamnit 2024-08-06 11:05:15 +05:30 committed by GitHub
parent 1441da895d
commit 92f4a023a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -383,5 +383,15 @@ function transformLinks(text: string): string {
/\[Telegram\]\(([^\)]*?)\)/gm,
'<a target="_blank" href="$1"><div alt="Telegram" class="i-mdi:telegram" /></a>'
)
// Transform Gitlab links to icons
.replace(
/\[GitLab\]\(([^\)]*?)\)/gm,
'<a target="_blank" href="$1"><div alt="GitLab" class="i-mdi:gitlab" /></a>'
)
// Fallback for GitHub
.replace(
/\[Gitlab\]\(([^\)]*?)\)/gm,
'<a target="_blank" href="$1"><div alt="GitLab" class="i-mdi:gitlab" /></a>'
)
return _text
}