add domain name after url text (#46)

This commit is contained in:
Sven Vogel 2024-08-22 10:51:35 +02:00
parent c60d81bd2d
commit 39c620c270
2 changed files with 8 additions and 2 deletions

View File

@ -40,7 +40,13 @@
} }
#let url(label, content) = { #let url(label, content) = {
link(label)[#underline(offset: 2pt, stroke: 0.5pt + blue, text(fill: blue, content))] link(label)[#underline(offset: 2pt, stroke: 0.5pt + blue, text(fill: blue)[
#content
#let domain = label.find(regex("\w+\.\w+(?:\.\w+)*"))
#if domain.len() > 0 [
(#domain)
]
])]
} }
// start of template pages and styles // start of template pages and styles

View File

@ -68,7 +68,7 @@ $
lorem(200), lorem(200),
) )
#url("https://github.com", "text (github.com)") #url("https://github.com", "text")
#lorem(50) #lorem(50)