Skip to content

Commit 98acc3d

Browse files
committed
chore: prepare README and CHANGELOG for release 1.0.2
1 parent e264b73 commit 98acc3d

3 files changed

Lines changed: 41 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
Change Log
22
==========
33

4+
## Version 1.0.2
5+
6+
_2024-10-20_
7+
8+
Bug fix:
9+
- Display the correct number of line breaks when a `<br>` tag is present between blocks requiring a single line break.
10+
11+
New features:
12+
- Allow disabling paragraph logic completely by setting an undefined indent unit to work around a bug in Compose UI.
13+
14+
This release depends on:
15+
- Kotlin **2.0.21**
16+
- Compose Multiplatform **1.7.0** (Jetpack Compose UI **1.7.1**)
17+
418
## Version 1.0.1
519

620
_2024-10-17_

README.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Add the dependency to your **module**'s `build.gradle` or `build.gradle.kts` fil
2424

2525
```kotlin
2626
dependencies {
27-
implementation("be.digitalia.compose.htmlconverter:htmlconverter:1.0.1")
27+
implementation("be.digitalia.compose.htmlconverter:htmlconverter:1.0.2")
2828
}
2929
```
3030

@@ -34,7 +34,7 @@ For Kotlin Multiplatform projects:
3434
sourceSets {
3535
val commonMain by getting {
3636
dependencies {
37-
implementation("be.digitalia.compose.htmlconverter:htmlconverter:1.0.1")
37+
implementation("be.digitalia.compose.htmlconverter:htmlconverter:1.0.2")
3838
}
3939
}
4040
}
@@ -66,7 +66,7 @@ Both functions take an optional `compactMode` boolean argument. When set to `tru
6666
The `htmlToAnnotatedString()` function takes an optional `style` argument of type `HtmlStyle` which allows to customize styling. The currently provided options are:
6767

6868
- `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.
7070

7171
For example, here is how to style hyperlinks to use the theme's primary color with no underline:
7272

@@ -111,6 +111,29 @@ Text(
111111
)
112112
```
113113

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`:
121+
122+
```kotlin
123+
val convertedText = remember(html) {
124+
htmlToAnnotatedString(
125+
html,
126+
style = HtmlStyle(indentUnit = TextUnit.Unspecified)
127+
)
128+
}
129+
Text(
130+
text = convertedText,
131+
maxLines = 3
132+
)
133+
```
134+
135+
See related bug reports [374115892](https://issuetracker.google.com/issues/374115892), [372390054](https://issuetracker.google.com/issues/372390054) on the Google issue tracker.
136+
114137
### Custom parsing
115138

116139
The `htmlToAnnotatedString()` and `htmlToString()` functions provide an overload that accepts an `HTMLParser` first argument in place of a `String`.

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ SONATYPE_CLOSE_TIMEOUT_SECONDS=1500
2222
RELEASE_SIGNING_ENABLED=true
2323

2424
GROUP=be.digitalia.compose.htmlconverter
25-
VERSION_NAME=1.0.1
25+
VERSION_NAME=1.0.2
2626

2727
POM_DESCRIPTION=HTML Converter for Compose
2828
POM_URL=https://github.com/cbeyls/HtmlConverterCompose

0 commit comments

Comments
 (0)