Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* [**] Reader: Add "Freshly Pressed" to Discover [#24828]
* [**] Intelligence: Expand AI-based features to more locales [#25034]
* [*] Fix previewing posts on WordPress.com atomic sites [#25045]
* [*] Reader: Collapse multiple spaces in site titles into one [#25094]

26.5
-----
Expand Down
2 changes: 1 addition & 1 deletion Sources/WordPressData/Swift/ReaderPost.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ extension ReaderPost {

public func blogNameForDisplay() -> String? {
if let blogName, !blogName.isEmpty {
return blogName
return blogName.replacing(/\s+/) { _ in " " }
}
return URL(string: blogURL ?? "")?.host
}
Expand Down
6 changes: 6 additions & 0 deletions Tests/KeystoneTests/Tests/Models/ReaderPostTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,10 @@ final class ReaderPostTests: CoreDataTestCase {
XCTAssertEqual(queryItems.first(where: { $0.name == "s" })?.value, Int(50 * UITraitCollection.current.displayScale).description)
XCTAssertEqual(queryItems.first(where: { $0.name == "d" })?.value, "404")
}

func testBlogNameorDisplay() {
let post = NSEntityDescription.insertNewObject(forEntityName: ReaderPost.entityName(), into: mainContext) as! ReaderPost
post.blogName = "t r e f o l o g y"
XCTAssertEqual(post.blogName, "t r e f o l o g y")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it supposed to check the blogNameForDisplay value?

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct ReaderFeedCell: View {

var title: String {
if let title = feed.title?.stringByDecodingXMLCharacters(), !title.isEmpty {
return title
return title.replacing(/\s+/) { _ in " " }
}
return feed.urlForDisplay ?? "–"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ReaderSiteHeaderView: ReaderBaseHeaderView, ReaderStreamHeader {
return
}
headerViewModel.site = siteTopic
headerViewModel.title = siteTopic.title
headerViewModel.title = siteTopic.title.replacing(/\s+/) { _ in " " }
headerViewModel.siteUrl = URL(string: siteTopic.siteURL)?.host ?? ""
headerViewModel.siteDetails = siteTopic.siteDescription
headerViewModel.postCount = siteTopic.postCount.doubleValue.abbreviatedString()
Expand Down