mirror of
https://github.com/fmhy/edit.git
synced 2026-01-17 17:31:18 +11:00
feat(transform): transform GitHub and Telegram links
This commit is contained in:
parent
a21b3e9e92
commit
dc08d06032
12 changed files with 39 additions and 13 deletions
|
|
@ -368,5 +368,20 @@ function transformLinks(text: string): string {
|
|||
/\[Discord\]\(([^\)]*?)\)/gm,
|
||||
'<a target="_blank" href="$1"><div alt="Discord" class="i-carbon:logo-discord" /></a>'
|
||||
)
|
||||
// Transform GitHub links to icons
|
||||
.replace(
|
||||
/\[GitHub\]\(([^\)]*?)\)/gm,
|
||||
'<a target="_blank" href="$1"><div alt="GitHub" class="i-carbon:logo-github mb-1" /></a>'
|
||||
)
|
||||
// Fallback for GitHub
|
||||
.replace(
|
||||
/\[Github\]\(([^\)]*?)\)/gm,
|
||||
'<a target="_blank" href="$1"><div alt="GitHub" class="i-carbon:logo-github mb-1" /></a>'
|
||||
)
|
||||
// Transform Telegram links to icons
|
||||
.replace(
|
||||
/\[Telegram\]\(([^\)]*?)\)/gm,
|
||||
'<a target="_blank" href="$1"><div alt="Telegram" class="i-mdi:telegram" /></a>'
|
||||
)
|
||||
return _text
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue