diff --git a/UnitTests/Sources/AttributedStringBuilderTests.swift b/UnitTests/Sources/AttributedStringBuilderTests.swift index fa21f00bc..1af255b28 100644 --- a/UnitTests/Sources/AttributedStringBuilderTests.swift +++ b/UnitTests/Sources/AttributedStringBuilderTests.swift @@ -745,6 +745,22 @@ class AttributedStringBuilderTests: XCTestCase { XCTAssertEqual(link.absoluteString, "https://matrix.org") } + func testValidLinkWithRTLOverride() { + let htmlString = "\u{202E}https://matrix.org" + + guard let attributedString = attributedStringBuilder.fromHTML(htmlString) else { + XCTFail("Could not build the attributed string") + return + } + + guard let link = attributedString.runs.first(where: { $0.link != nil })?.link else { + XCTFail("Couldn't find the link") + return + } + XCTAssertFalse(link.requiresConfirmation) + XCTAssertEqual(link.absoluteString, "https://matrix.org") + } + func testPhishingUserID() { let htmlString = "Hey check the following user @alice:matrix.org"