Trim whitespace from webpage titles in StatusCardControl (#1020)
This commit is contained in:
parent
3369971b7d
commit
ad5070d2b9
|
@ -138,13 +138,14 @@ public final class StatusCardControl: UIControl {
|
||||||
}
|
}
|
||||||
|
|
||||||
public func configure(card: Card) {
|
public func configure(card: Card) {
|
||||||
|
let title = card.title.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||||
if let host = card.url?.host {
|
if let host = card.url?.host {
|
||||||
accessibilityLabel = "\(card.title) \(host)"
|
accessibilityLabel = "\(title) \(host)"
|
||||||
} else {
|
} else {
|
||||||
accessibilityLabel = card.title
|
accessibilityLabel = title
|
||||||
}
|
}
|
||||||
|
|
||||||
titleLabel.text = card.title
|
titleLabel.text = title
|
||||||
linkLabel.text = card.url?.host
|
linkLabel.text = card.url?.host
|
||||||
imageView.contentMode = .center
|
imageView.contentMode = .center
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue