Trim whitespace from webpage titles in StatusCardControl (#1020)

This commit is contained in:
Jed Fox 2023-04-17 06:09:36 -04:00 committed by GitHub
parent 3369971b7d
commit ad5070d2b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -138,13 +138,14 @@ public final class StatusCardControl: UIControl {
}
public func configure(card: Card) {
let title = card.title.trimmingCharacters(in: .whitespacesAndNewlines)
if let host = card.url?.host {
accessibilityLabel = "\(card.title) \(host)"
accessibilityLabel = "\(title) \(host)"
} else {
accessibilityLabel = card.title
accessibilityLabel = title
}
titleLabel.text = card.title
titleLabel.text = title
linkLabel.text = card.url?.host
imageView.contentMode = .center