fromMarkdown

fun AnnotatedString.Companion.fromMarkdown(markdownString: String, linkInteractionListener: LinkInteractionListener? = null): AnnotatedString

Constructs an AnnotatedString from Markdown.

Supported inline Markdown:

  • Links: url

  • Bold: text or text

  • Italic: text or text

  • Strikethrough: text

  • Inline Code: text

Return

an AnnotatedString.

Parameters

markdownString

a string with Markdown formatting.

linkInteractionListener

a LinkInteractionListener to detect when a link has been clicked or null to have the platform handle it.