mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Add support for the <strike> tag in the attributed string builder
This commit is contained in:
@@ -673,6 +673,17 @@ struct AttributedStringBuilderTests {
|
||||
#expect(String(attributedString.characters) == "one two")
|
||||
}
|
||||
|
||||
@Test
|
||||
func strikethroughTags() throws {
|
||||
var strikethrough = AttributedString("one")
|
||||
strikethrough[AttributeScopes.UIKitAttributes.StrikethroughStyleAttribute.self] = .single
|
||||
|
||||
for tag in ["s", "del", "strike"] {
|
||||
let attributedString = try #require(attributedStringBuilder.fromHTML("<\(tag)>one</\(tag)>"), "Could not build the attributed string")
|
||||
#expect(attributedString == strikethrough, "<\(tag)> should render as a strikethrough")
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
func unorderedList() throws {
|
||||
let htmlString = "<ul><li>1</li><li>2</li><li>3</li></ul>"
|
||||
|
||||
Reference in New Issue
Block a user