You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -66,7 +66,7 @@ Both functions take an optional `compactMode` boolean argument. When set to `tru
66
66
The `htmlToAnnotatedString()` function takes an optional `style` argument of type `HtmlStyle` which allows to customize styling. The currently provided options are:
67
67
68
68
-`textLinkStyles`: Optional collection of styles for hyperlinks (content of `a` tags). Default is a simple underline. When set to `null`, hyperlinks will not be styled, which can be useful when they are not clickable (see next section).
69
-
-`indentUnit`: Unit of indentation for block quotations and nested lists. Default is **24 sp**. Note that `em` units are not yet supported for indentation in Compose Desktop.
69
+
-`indentUnit`: Unit of indentation for block quotations and nested lists. Default is **24 sp**. Note that `em` units are not yet supported for indentation in Compose Desktop. Set to `0.sp` or `TextUnit.Unspecified` to disable indentation support.
70
70
71
71
For example, here is how to style hyperlinks to use the theme's primary color with no underline:
72
72
@@ -111,6 +111,29 @@ Text(
111
111
)
112
112
```
113
113
114
+
### Bug when showing hyperlinks in combination with maxLines
115
+
116
+
Compose UI 1.7.x has an unsolved bug which triggers a crash when a `Text` composable using `maxLines` is displaying an `AnnotatedString` containing a `LinkAnnotation` inside a paragraph.
117
+
118
+
This library is vulnerable to that bug because it uses both `LinkAnnotation` to display hyperlinks and paragraphs to handle text indentation.
119
+
120
+
As a workaround, you can disable indentation support in `Text` composables which require the usage of `maxLines`:
See related bug reports [374115892](https://issuetracker.google.com/issues/374115892), [372390054](https://issuetracker.google.com/issues/372390054) on the Google issue tracker.
136
+
114
137
### Custom parsing
115
138
116
139
The `htmlToAnnotatedString()` and `htmlToString()` functions provide an overload that accepts an `HTMLParser` first argument in place of a `String`.
0 commit comments