diff --git a/Sources/HTMLStreamer/AttributedStringConverter.swift b/Sources/HTMLStreamer/AttributedStringConverter.swift index 9846804..f3b3b7d 100644 --- a/Sources/HTMLStreamer/AttributedStringConverter.swift +++ b/Sources/HTMLStreamer/AttributedStringConverter.swift @@ -45,6 +45,8 @@ public struct AttributedStringConverter { actionStack = [] styleStack = [] + previouslyFinishedBlockElement = false + currentElementIsEmpty = true currentRun = "" while let token = tokenizer.next() { diff --git a/Sources/HTMLStreamer/TextConverter.swift b/Sources/HTMLStreamer/TextConverter.swift index 1237625..4b8428e 100644 --- a/Sources/HTMLStreamer/TextConverter.swift +++ b/Sources/HTMLStreamer/TextConverter.swift @@ -31,6 +31,10 @@ public struct TextConverter { tokenizer = Tokenizer(chars: html.unicodeScalars.makeIterator()) str = "" + previouslyFinishedBlockElement = false + currentElementIsEmpty = true + currentRun = "" + while let token = tokenizer.next() { switch token { case .character(let scalar):