#How to include decorator in link body

17 messages · Page 1 of 1 (latest)

manic swallow
#

im decorating links and want to make the circle clickable too
thought of wrapping it in a link() inside the show rule, but that'd exceed max nesting allowed

#

?r theme=light

#set text(size: 18pt)

#show link: it => {
  it
  h(0.06em)
  super(box(height: 5pt, circle(radius: 2pt, stroke: 1.2pt + red)))
}

#link("https://typeof.net/Iosevka/")[_Iosevka_]
drifting grotto
#

Which version of typst are you using?

manic swallow
#
$ typst --version
typst 0.11.0
drifting grotto
manic swallow
drifting grotto
#

But it works here, in bot. Probably you doing something very nested

#

I'm talking about "max nesting allowed"

manic swallow
#

?r theme=light

#set text(size: 18pt)

#show link: it => {
  it
  link(it.dest)[#super(box(height: 5pt, circle(radius: 2pt, stroke: 1.2pt + red)))]
}

#link("https://typeof.net/Iosevka/")[_Iosevka_]
wicked otterBOT
manic swallow
#

bump

drifting grotto
#

I think that's because you make a new link, and it matches the same show rule, and so on, and so on, until it reaches the limit

#

Why do you want to make a circle clickable?

#

It's pretty small

drifting grotto
#

You can try to use state for this too