Fix TextConverterConfiguration property name
This commit is contained in:
parent
5bdfda71e6
commit
f585a6b502
|
@ -129,7 +129,7 @@ public struct TextConverter<Callbacks: HTMLConversionCallbacks> {
|
||||||
public struct TextConverterConfiguration {
|
public struct TextConverterConfiguration {
|
||||||
public var insertNewlines: Bool
|
public var insertNewlines: Bool
|
||||||
|
|
||||||
public init(insertWhitespace: Bool = true) {
|
public init(insertNewlines: Bool = true) {
|
||||||
self.insertNewlines = insertWhitespace
|
self.insertNewlines = insertNewlines
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,12 +34,12 @@ final class TextConverterTests: XCTestCase {
|
||||||
|
|
||||||
func testTextAfterBlockElement() {
|
func testTextAfterBlockElement() {
|
||||||
XCTAssertEqual(convert("<blockquote>wee</blockquote>after"), "wee\n\nafter")
|
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() {
|
func testMultipleBlockElements() {
|
||||||
XCTAssertEqual(convert("<blockquote>a</blockquote><blockquote>b</blockquote>"), "a\n\nb")
|
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() {
|
func testElementActionCallback() {
|
||||||
|
|
Loading…
Reference in New Issue