diff --git a/Sources/HTMLStreamer/TextConverter.swift b/Sources/HTMLStreamer/TextConverter.swift index 870ef34..3f89151 100644 --- a/Sources/HTMLStreamer/TextConverter.swift +++ b/Sources/HTMLStreamer/TextConverter.swift @@ -129,7 +129,7 @@ public struct TextConverter { public struct TextConverterConfiguration { public var insertNewlines: Bool - public init(insertWhitespace: Bool = true) { - self.insertNewlines = insertWhitespace + public init(insertNewlines: Bool = true) { + self.insertNewlines = insertNewlines } } diff --git a/Tests/HTMLStreamerTests/TextConverterTests.swift b/Tests/HTMLStreamerTests/TextConverterTests.swift index aa970c9..485aa60 100644 --- a/Tests/HTMLStreamerTests/TextConverterTests.swift +++ b/Tests/HTMLStreamerTests/TextConverterTests.swift @@ -34,12 +34,12 @@ final class TextConverterTests: XCTestCase { func testTextAfterBlockElement() { XCTAssertEqual(convert("
wee
after"), "wee\n\nafter") - XCTAssertEqual(convert("
wee
after", configuration: .init(insertWhitespace: false)), "wee after") + XCTAssertEqual(convert("
wee
after", configuration: .init(insertNewlines: false)), "wee after") } func testMultipleBlockElements() { XCTAssertEqual(convert("
a
b
"), "a\n\nb") - XCTAssertEqual(convert("
a
b
", configuration: .init(insertWhitespace: false)), "a b") + XCTAssertEqual(convert("
a
b
", configuration: .init(insertNewlines: false)), "a b") } func testElementActionCallback() {