Fix converter state not being reset
This commit is contained in:
parent
b33be0f178
commit
64b68a6cec
|
@ -45,6 +45,8 @@ public struct AttributedStringConverter<Callbacks: HTMLConversionCallbacks> {
|
||||||
|
|
||||||
actionStack = []
|
actionStack = []
|
||||||
styleStack = []
|
styleStack = []
|
||||||
|
previouslyFinishedBlockElement = false
|
||||||
|
currentElementIsEmpty = true
|
||||||
currentRun = ""
|
currentRun = ""
|
||||||
|
|
||||||
while let token = tokenizer.next() {
|
while let token = tokenizer.next() {
|
||||||
|
|
|
@ -31,6 +31,10 @@ public struct TextConverter<Callbacks: HTMLConversionCallbacks> {
|
||||||
tokenizer = Tokenizer(chars: html.unicodeScalars.makeIterator())
|
tokenizer = Tokenizer(chars: html.unicodeScalars.makeIterator())
|
||||||
str = ""
|
str = ""
|
||||||
|
|
||||||
|
previouslyFinishedBlockElement = false
|
||||||
|
currentElementIsEmpty = true
|
||||||
|
currentRun = ""
|
||||||
|
|
||||||
while let token = tokenizer.next() {
|
while let token = tokenizer.next() {
|
||||||
switch token {
|
switch token {
|
||||||
case .character(let scalar):
|
case .character(let scalar):
|
||||||
|
|
Loading…
Reference in New Issue