Skip to content

Commit 2be96f0

Browse files
chore(deps): bump org.jsoup:jsoup from 1.19.1 to 1.21.1 (#1365)
Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ian Botsford <[email protected]>
1 parent 5af711e commit 2be96f0

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/lang/DocumentationPreprocessor.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,18 @@ class DocumentationPreprocessor : KotlinIntegration {
5757
.applyWithin("<pre>", "</pre>", String::escapeHtml)
5858
val parsed = Jsoup.parse(sanitized)
5959

60+
fun Node.emptyOrBlank(): Boolean = when {
61+
this is TextNode -> isBlank
62+
else -> childNodes().all { it.emptyOrBlank() }
63+
}
64+
6065
parsed.body().filterDescendants(
6166
// Jsoup will preserve newlines between elements as blank text nodes. These have zero bearing on the content
6267
// of the document to begin with and only serve to complicate traversal.
6368
{ it is TextNode && it.isBlank },
6469
// Some docs contain empty definition terms, which we render as section headers. An empty section header
6570
// (literal "## \n" is invalid markdown according to dokka.
66-
{ it.nodeName() == "dt" && it.childNodes().isEmpty() },
71+
{ it.nodeName() == "dt" && it.emptyOrBlank() },
6772
)
6873

6974
return parsed

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ kotlinx-serialization-version = "1.7.3"
2929
docker-java-version = "3.4.0"
3030
ktor-version = "3.2.3"
3131
kaml-version = "0.55.0"
32-
jsoup-version = "1.19.1"
32+
jsoup-version = "1.21.1"
3333

3434
[libraries]
3535
aws-kotlin-repo-tools-build-support = { module="aws.sdk.kotlin.gradle:build-support", version.ref = "aws-kotlin-repo-tools-version" }

0 commit comments

Comments
 (0)