Remove tagStack
This commit is contained in:
parent
951ffeb899
commit
d47767d8b4
|
@ -134,7 +134,6 @@ extension NSAttributedString {
|
||||||
|
|
||||||
var inTag: InTag = .none
|
var inTag: InTag = .none
|
||||||
var tag = ""
|
var tag = ""
|
||||||
var tagStack = [String]()
|
|
||||||
var currentStyles = CountedSet<Style>()
|
var currentStyles = CountedSet<Style>()
|
||||||
|
|
||||||
var iterator = html.makeIterator()
|
var iterator = html.makeIterator()
|
||||||
|
@ -164,8 +163,6 @@ extension NSAttributedString {
|
||||||
attributeRanges.append( (range: range, styles: currentStyles) )
|
attributeRanges.append( (range: range, styles: currentStyles) )
|
||||||
|
|
||||||
if inTag == .opening {
|
if inTag == .opening {
|
||||||
tagStack.append(tag)
|
|
||||||
|
|
||||||
if tag == "q" {
|
if tag == "q" {
|
||||||
quoteDepth += 1
|
quoteDepth += 1
|
||||||
let delimiter = quoteDepth % 2 == 1 ? locale.quotationBeginDelimiter : locale.alternateQuotationBeginDelimiter
|
let delimiter = quoteDepth % 2 == 1 ? locale.quotationBeginDelimiter : locale.alternateQuotationBeginDelimiter
|
||||||
|
@ -185,8 +182,6 @@ extension NSAttributedString {
|
||||||
if let style = Style(forTag: tag) {
|
if let style = Style(forTag: tag) {
|
||||||
currentStyles.remove(style)
|
currentStyles.remove(style)
|
||||||
}
|
}
|
||||||
|
|
||||||
let _ = tagStack.popLast() // TODO: Handle improperly-nested tags
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inTag = .none
|
inTag = .none
|
||||||
|
|
Loading…
Reference in New Issue