Is it possible to make a breakable box or inline?

I’ve tried to use box to add a background to any link in my document. Problem is: there’s no breakable argument in box (allowing the box to break between lines). This argument only exists for block element.

Is it possible to make a breakable inline? I’ve searched through docs, forum and repository and didn’t find any mention to that…

Thank you in advance!

I’m not sure if you can achieve that with a box, but if you want to add a background color to your links you can combine a show rule with highlight:

#show link: it => highlight(fill: blue, it)

Breakable link with background:
#link("https://typst.app")[#lorem(50)]
2 Likes

No, box can’t be broken, that’s the point. You only want to break blocks, hence block has a parameter for that.

FYI, a slightly simpler way to do this is:

#show link: highlight.with(fill: blue)
2 Likes