diff --git a/html-text/src/main/java/de/charlex/compose/HtmlText.kt b/html-text/src/main/java/de/charlex/compose/HtmlText.kt index 422bac0..2853e31 100644 --- a/html-text/src/main/java/de/charlex/compose/HtmlText.kt +++ b/html-text/src/main/java/de/charlex/compose/HtmlText.kt @@ -76,13 +76,13 @@ fun HtmlText( ) { val context = LocalContext.current val annotatedString = context.resources.getText(textId).toAnnotatedString(urlSpanStyle, colorMapping) - val clickable = annotatedString.getStringAnnotations(0, annotatedString.length-1).any { it.tag == "url" } + val clickable = annotatedString.getStringAnnotations(0, annotatedString.length - 1).any { it.tag == "url" } val uriHandler = LocalUriHandler.current val layoutResult = remember { mutableStateOf(null) } Text( - modifier = modifier.then(if(clickable) Modifier.pointerInput(Unit) { + modifier = modifier.then(if (clickable) Modifier.pointerInput(Unit) { detectTapGestures(onTap = { pos -> layoutResult.value?.let { layoutResult -> val position = layoutResult.getOffsetForPosition(pos) @@ -165,13 +165,13 @@ fun HtmlText( Html.fromHtml(text, Html.FROM_HTML_MODE_LEGACY) }.toAnnotatedString(urlSpanStyle, colorMapping) - val clickable = annotatedString.getStringAnnotations(0, annotatedString.length-1).any { it.tag == "url" } + val clickable = annotatedString.getStringAnnotations(0, annotatedString.length - 1).any { it.tag == "url" } val uriHandler = LocalUriHandler.current val layoutResult = remember { mutableStateOf(null) } Text( - modifier = modifier.then(if(clickable) Modifier.pointerInput(Unit) { + modifier = modifier.then(if (clickable) Modifier.pointerInput(Unit) { detectTapGestures(onTap = { pos -> layoutResult.value?.let { layoutResult -> val position = layoutResult.getOffsetForPosition(pos)