Remove extra new line before list items and useless paragraph style

This commit is contained in:
Stefan Ceriu
2025-09-16 16:37:02 +03:00
committed by Stefan Ceriu
parent f33d29b7e9
commit a1038f0ffe
6 changed files with 23 additions and 16 deletions
@@ -738,6 +738,21 @@ class AttributedStringBuilderV1Tests: XCTestCase {
}
}
func testListTags() {
let htmlString = "<p>like</p>\n<ul>\n<li>this<br />\ntest</li>\n</ul>\n"
guard let attributedString = attributedStringBuilder.fromHTML(htmlString) else {
XCTFail("Could not build the attributed string")
return
}
if AttributedStringBuilder.useNextGenHTMLParser {
XCTAssertEqual(String(attributedString.characters), "like\n\n • this\ntest")
} else {
XCTAssertEqual(String(attributedString.characters), "like\n\t•\tthis\u{2028}test")
}
}
// MARK: - Phishing prevention
func testPhishingLink() {