title: Jetpack Compose Text hyperlink some section of the text
body: <p>How can i add hyperlink to some section of the text of Text component?</p>
  <p>With <code>buildAnnotatedString</code> i can set <em>link</em> section blue and underlined  as in image below, but how can i also turn that section into link?</p>
  <p><a href="https://i.stack.imgur.com/2wbE8.png" rel="noreferrer"><img src="https://i.stack.imgur.com/2wbE8.png" alt="enter image description here" /></a></p>
  <pre><code>   val annotatedLinkString = buildAnnotatedString {
          val str = &quot;Click this link to go to web site&quot;
          val startIndex = str.indexOf(&quot;link&quot;)
          val endIndex = startIndex + 4
          append(str)
          addStyle(
              style = SpanStyle(
                  color = Color(0xff64B5F6),
                  textDecoration = TextDecoration.Underline
              ), start = startIndex, end = endIndex
          )
      }
  
      Text(
          modifier = modifier
              .padding(16.dp)
              .fillMaxWidth(),
          text = annotatedLinkString
      )
  </code></pre>
  <p>I can also get <code>Spanned</code> but is there any way to use it with <code>Text</code>?</p>
  <pre><code>val str: Spanned = HtmlCompat.fromHtml(
      &quot;&lt;a href=\&quot;http://www.github.com\&quot;&gt;Github&lt;/a&gt;&quot;, HtmlCompat.FROM_HTML_MODE_LEGACY
  )
  </code></pre>