Fix TextConverterConfiguration property name

This commit is contained in:
Shadowfacts 2023-12-23 10:45:11 -05:00
parent 5bdfda71e6
commit f585a6b502
2 changed files with 4 additions and 4 deletions

View File

@ -129,7 +129,7 @@ public struct TextConverter<Callbacks: HTMLConversionCallbacks> {
public struct TextConverterConfiguration {
public var insertNewlines: Bool
public init(insertWhitespace: Bool = true) {
self.insertNewlines = insertWhitespace
public init(insertNewlines: Bool = true) {
self.insertNewlines = insertNewlines
}
}

View File

@ -34,12 +34,12 @@ final class TextConverterTests: XCTestCase {
func testTextAfterBlockElement() {
XCTAssertEqual(convert("<blockquote>wee</blockquote>after"), "wee\n\nafter")
XCTAssertEqual(convert("<blockquote>wee</blockquote>after", configuration: .init(insertWhitespace: false)), "wee after")
XCTAssertEqual(convert("<blockquote>wee</blockquote>after", configuration: .init(insertNewlines: false)), "wee after")
}
func testMultipleBlockElements() {
XCTAssertEqual(convert("<blockquote>a</blockquote><blockquote>b</blockquote>"), "a\n\nb")
XCTAssertEqual(convert("<blockquote>a</blockquote><blockquote>b</blockquote>", configuration: .init(insertWhitespace: false)), "a b")
XCTAssertEqual(convert("<blockquote>a</blockquote><blockquote>b</blockquote>", configuration: .init(insertNewlines: false)), "a b")
}
func testElementActionCallback() {