Convert to an if-let since currentStyles are being stored instead of a single style
This commit is contained in:
parent
7f3b77b760
commit
b7916f7d31
|
@ -172,12 +172,10 @@ extension NSAttributedString {
|
||||||
let location = lastRange != nil ? lastRange!.location + lastRange!.length : 0
|
let location = lastRange != nil ? lastRange!.location + lastRange!.length : 0
|
||||||
let range = NSRange(location: location, length: result.mutableString.length - location)
|
let range = NSRange(location: location, length: result.mutableString.length - location)
|
||||||
|
|
||||||
let style = Style(tag: tag)
|
|
||||||
|
|
||||||
attributeRanges.append( (range: range, styles: currentStyles) )
|
attributeRanges.append( (range: range, styles: currentStyles) )
|
||||||
|
|
||||||
if style != nil {
|
if let style = Style(tag: tag) {
|
||||||
currentStyles.insert(style!)
|
currentStyles.insert(style)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if tag == "q" {
|
if tag == "q" {
|
||||||
|
|
Loading…
Reference in New Issue