withLink

DSL helper for applying link formatting to a block of text.

This is the recommended way to add links as it automatically manages the annotation stack.

Example:

buildOudsAnnotatedAlertMessageDescription {
append("Please read the ")
withLink(OudsLinkAnnotation.Url("https://example.com/terms")) {
append("terms and conditions")
}
append(" carefully")
}

Return

The result of the block.

Parameters

link

The link annotation (URL or clickable).

block

The lambda that appends the text to be formatted as a link.