Skip to content

pull comments link from article when fetching feeds from sync provider#1215

Open
TateWalker wants to merge 2 commits into
prof18:mainfrom
TateWalker:main
Open

pull comments link from article when fetching feeds from sync provider#1215
TateWalker wants to merge 2 commits into
prof18:mainfrom
TateWalker:main

Conversation

@TateWalker

Copy link
Copy Markdown

When fetching articles from GReader-compatible sync providers (e.g. FreshRSS), the commentsUrl field was always null. This adds extractCommentsUrl to the HtmlParser interface and implements it on both JVM/Android (Jsoup) and iOS (SwiftSoup) by finding the first anchor whose text is "Comments" (case-insensitive).

The ItemContentDTOMapper now calls this parser method on article content HTML to populate commentsUrl when present.

Changes

  • Added extractCommentsUrl(html) to HtmlParser interface with JVM and iOS implementations
  • Updated ItemContentDTOMapper to extract the comments URL from article content instead of always returning null
  • Updated all fake HtmlParser implementations in tests to satisfy the new interface method
  • Added unit tests for JvmHtmlParser and ItemContentDTOMapper covering present, absent, null-content, and case-insensitive scenarios

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant