diff --git a/simplified-opds-core/build.gradle.kts b/simplified-opds-core/build.gradle.kts index e79be5f4f..20db75b5f 100644 --- a/simplified-opds-core/build.gradle.kts +++ b/simplified-opds-core/build.gradle.kts @@ -12,6 +12,7 @@ dependencies { implementation(libs.jackson.databind) implementation(libs.javax.annotation.api) implementation(libs.joda.time) + implementation(libs.jsoup) implementation(libs.kotlin.reflect) implementation(libs.kotlin.stdlib) implementation(libs.slf4j) diff --git a/simplified-opds-core/src/main/java/org/nypl/simplified/opds/core/OPDSAcquisitionFeedEntry.java b/simplified-opds-core/src/main/java/org/nypl/simplified/opds/core/OPDSAcquisitionFeedEntry.java index eebbffcbe..4ea1d1f97 100644 --- a/simplified-opds-core/src/main/java/org/nypl/simplified/opds/core/OPDSAcquisitionFeedEntry.java +++ b/simplified-opds-core/src/main/java/org/nypl/simplified/opds/core/OPDSAcquisitionFeedEntry.java @@ -8,6 +8,7 @@ import com.io7m.jnull.Nullable; import org.joda.time.DateTime; +import org.jsoup.Jsoup; import org.nypl.simplified.parser.api.ParseError; import java.io.Serializable; @@ -721,7 +722,12 @@ public OPDSAcquisitionFeedEntryBuilderType setSummaryOption( if (text.isNone()) { this.summary = ""; } else { - this.summary = ((Some) text).get(); + final String s = ((Some) text).get(); + try { + this.summary = Jsoup.parse(s).text(); + } catch (final Exception e) { + this.summary = s; + } } return this; } diff --git a/simplified-tests/build.gradle.kts b/simplified-tests/build.gradle.kts index 14c5738a1..a7dc68a73 100644 --- a/simplified-tests/build.gradle.kts +++ b/simplified-tests/build.gradle.kts @@ -193,6 +193,7 @@ val dependencyObjects = listOf( libs.javax.inject, libs.jcip.annotations, libs.joda.time, + libs.jsoup, libs.junit, libs.junit.jupiter.api, libs.junit.jupiter.engine,