We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7de6931 commit ef14a45Copy full SHA for ef14a45
Sources/SwiftRichString/Style/StyleProtocol.swift
@@ -51,10 +51,7 @@ public extension StyleProtocol {
51
func set(to source: String, range: NSRange?) -> AttributedString {
52
let attributedText = NSMutableAttributedString(string: source)
53
self.fontData?.addAttributes(to: attributedText, range: nil)
54
- guard let range = range else {
55
- return attributedText
56
- }
57
- attributedText.setAttributes(self.attributes, range: range)
+ attributedText.setAttributes(self.attributes, range: (range ?? NSMakeRange(0, source.count)))
58
return attributedText
59
}
60
0 commit comments