From 876099679c5c39c82e5f5489d4c03badf44d157a Mon Sep 17 00:00:00 2001 From: Sasikanth Miriyampalli Date: Wed, 7 Feb 2024 16:15:59 +0530 Subject: [PATCH] Add support for summary tag for entry in atom feed parser --- .../rss/reader/core/network/parser/AtomContentParser.kt | 4 +++- .../sasikanth/rss/reader/core/network/parser/FeedParser.kt | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/core/network/src/commonMain/kotlin/dev/sasikanth/rss/reader/core/network/parser/AtomContentParser.kt b/core/network/src/commonMain/kotlin/dev/sasikanth/rss/reader/core/network/parser/AtomContentParser.kt index e567948cd..af42afa80 100644 --- a/core/network/src/commonMain/kotlin/dev/sasikanth/rss/reader/core/network/parser/AtomContentParser.kt +++ b/core/network/src/commonMain/kotlin/dev/sasikanth/rss/reader/core/network/parser/AtomContentParser.kt @@ -27,6 +27,7 @@ import dev.sasikanth.rss.reader.core.network.parser.FeedParser.Companion.TAG_CON import dev.sasikanth.rss.reader.core.network.parser.FeedParser.Companion.TAG_LINK import dev.sasikanth.rss.reader.core.network.parser.FeedParser.Companion.TAG_PUBLISHED import dev.sasikanth.rss.reader.core.network.parser.FeedParser.Companion.TAG_SUBTITLE +import dev.sasikanth.rss.reader.core.network.parser.FeedParser.Companion.TAG_SUMMARY import dev.sasikanth.rss.reader.core.network.parser.FeedParser.Companion.TAG_TITLE import dev.sasikanth.rss.reader.core.network.parser.FeedParser.Companion.TAG_UPDATED import io.ktor.http.Url @@ -115,7 +116,8 @@ internal object AtomContentParser : ContentParser() { skip(parser) } } - TAG_CONTENT -> { + TAG_CONTENT, + TAG_SUMMARY -> { rawContent = readTagText(tagName, parser).trimIndent() val htmlContent = HtmlContentParser.parse(htmlContent = rawContent) diff --git a/core/network/src/commonMain/kotlin/dev/sasikanth/rss/reader/core/network/parser/FeedParser.kt b/core/network/src/commonMain/kotlin/dev/sasikanth/rss/reader/core/network/parser/FeedParser.kt index 15d0bb17f..bcd1e9101 100644 --- a/core/network/src/commonMain/kotlin/dev/sasikanth/rss/reader/core/network/parser/FeedParser.kt +++ b/core/network/src/commonMain/kotlin/dev/sasikanth/rss/reader/core/network/parser/FeedParser.kt @@ -86,6 +86,7 @@ class FeedParser(private val dispatchersProvider: DispatchersProvider) { internal const val TAG_ENCLOSURE = "enclosure" internal const val TAG_CONTENT_ENCODED = "content:encoded" internal const val TAG_CONTENT = "content" + internal const val TAG_SUMMARY = "summary" internal const val TAG_SUBTITLE = "subtitle" internal const val TAG_PUB_DATE = "pubDate" internal const val TAG_PUBLISHED = "published"