mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Permalink Tweaks 2 (#2766)
* Missing changelog. * Parse bare room aliases as permalinks. Update the SDK. * Fix tapping the same permalink twice. Add a test. Don't clear the focussed item when reaching the bottom of the timeline. * Make sure sending a message returns to live.
This commit is contained in:
@@ -188,13 +188,24 @@ class AttributedStringBuilderTests: XCTestCase {
|
||||
checkLinkIn(attributedString: attributedStringBuilder.fromPlain(string), expectedLink: string, expectedRuns: 1)
|
||||
}
|
||||
|
||||
func testUserIdLink() {
|
||||
let userId = "@user:matrix.org"
|
||||
let string = "The user is \(userId)."
|
||||
let expectedLink = "https://matrix.to/#/\(userId)"
|
||||
func testUserIDLink() {
|
||||
let userID = "@user:matrix.org"
|
||||
let string = "The user is \(userID)."
|
||||
let expectedLink = "https://matrix.to/#/\(userID)"
|
||||
checkLinkIn(attributedString: attributedStringBuilder.fromHTML(string), expectedLink: expectedLink, expectedRuns: 3)
|
||||
checkLinkIn(attributedString: attributedStringBuilder.fromPlain(string), expectedLink: expectedLink, expectedRuns: 3)
|
||||
}
|
||||
|
||||
func testRoomAliasLink() {
|
||||
let roomAlias = "#room:matrix.org"
|
||||
let string = "The room is \(roomAlias)."
|
||||
guard let expectedLink = URL(string: "https://matrix.to/#/\(roomAlias)") else {
|
||||
XCTFail("The expected link should be valid.")
|
||||
return
|
||||
}
|
||||
checkLinkIn(attributedString: attributedStringBuilder.fromHTML(string), expectedLink: expectedLink.absoluteString, expectedRuns: 3)
|
||||
checkLinkIn(attributedString: attributedStringBuilder.fromPlain(string), expectedLink: expectedLink.absoluteString, expectedRuns: 3)
|
||||
}
|
||||
|
||||
func testDefaultFont() {
|
||||
let htmlString = "<b>Test</b> <i>string</i>."
|
||||
|
||||
Reference in New Issue
Block a user