<div class='type'>Function</div>


<a id='references'></a>


<h2 id="withlink-link-block">withLink</h2>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
inline fun <R : Any> Builder.withLink(link: LinkAnnotation, block: Builder.() -> R): R
```


Pushes a `LinkAnnotation` to the `AnnotatedString.Builder`, executes `block` and then pops the
annotation.

#### Parameters

| | |
| --- | --- |
| link | A `LinkAnnotation` object representing a clickable part of the text |
| block | function to be executed |


#### Returns

| | |
| --- | --- |
|  | result of the `block` |