Skip to content

Commit 49e992d

Browse files
committed
Apply suggestions from code review.
#548 (comment) #548 (comment)
1 parent 1a13ea0 commit 49e992d

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

Shared/Supporting Files/Views/SampleLink.swift

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,10 @@ private extension String {
134134
var attributedString = AttributedString(self)
135135

136136
let trimmedSubstring = substring.trimmingCharacters(in: .whitespacesAndNewlines)
137-
if let range = localizedStandardRange(of: trimmedSubstring) {
138-
let substring = self[range]
139-
140-
if let boldedSubstring = try? AttributedString(markdown: "**\(substring)**"),
141-
let attributedRange = attributedString.range(of: substring) {
142-
attributedString.replaceSubrange(attributedRange, with: boldedSubstring)
143-
}
137+
if let range = localizedStandardRange(of: trimmedSubstring),
138+
let boldedSubstring = try? AttributedString(markdown: "**\(self[range])**"),
139+
let attributedRange = attributedString.range(of: self[range]) {
140+
attributedString.replaceSubrange(attributedRange, with: boldedSubstring)
144141
}
145142

146143
return attributedString

0 commit comments

Comments
 (0)