Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Commit a4f9816

Browse files
authored
Merge pull request #1802 from BrianLitwin/Issue#120Fixed
Brackets inside link text fixed
2 parents de801c5 + f3c65d0 commit a4f9816

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

FreetimeTests/IssueTests.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,5 +254,23 @@ class IssueTests: XCTestCase {
254254
XCTAssertNotNil(attrText.attributes(at: 2, effectiveRange: nil)[.attachment])
255255
XCTAssertNotNil(attrText.attributes(at: 11, effectiveRange: nil)[.attachment])
256256
}
257+
258+
func test_linkContainingBrackets() {
259+
260+
// Issue #120
261+
// the [\\[Pitch\\] slashes at one point rendered incorrectly as \[Pitch\] instead of [Pitch]
262+
263+
let body = "...adoption.\r\n\r\nSee: [\\[Pitch\\] Introducing the \"Unwrap or Die\" operator to the standard library](https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20170626/037730.html)"
264+
let models = MarkdownModels(
265+
body,
266+
owner: "owner",
267+
repo: "repo",
268+
width: 0,
269+
viewerCanUpdate: false,
270+
contentSizeCategory: .large
271+
)
272+
273+
XCTAssertEqual((models[1] as! StyledTextRenderer).string.allText, "See: [Pitch] Introducing the \"Unwrap or Die\" operator to the standard library")
274+
}
257275

258276
}

0 commit comments

Comments
 (0)