mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Fix inline code being rendered as blocks. (#5017)
* Fix inline code being rendered as blocks. And make blocks non-greedy as well as only scrolling when needed. * Rename the bubble layout priorities. * Add an InlineCode attribute so that the builder also strips links from these too. * Split up the snapshot tests into individual cases. This should make it much easier to see *what* has changed when regenerating.
This commit is contained in:
@@ -32,7 +32,7 @@ class AttributedStringBuilderTests: XCTestCase {
|
||||
}
|
||||
|
||||
func testRenderHTMLStringWithPreCode() {
|
||||
guard let attributedString = attributedStringBuilder.fromHTML(HTMLFixtures.codeBlocks.rawValue) else {
|
||||
guard let attributedString = attributedStringBuilder.fromHTML(HTMLFixtures.code.rawValue) else {
|
||||
XCTFail("Could not build the attributed string")
|
||||
return
|
||||
}
|
||||
@@ -46,7 +46,7 @@ class AttributedStringBuilderTests: XCTestCase {
|
||||
return
|
||||
}
|
||||
|
||||
XCTAssertEqual(regex.numberOfMatches(in: string, options: [], range: .init(location: 0, length: string.count)), 13)
|
||||
XCTAssertEqual(regex.numberOfMatches(in: string, options: [], range: .init(location: 0, length: string.count)), 23)
|
||||
}
|
||||
|
||||
func testRenderHTMLStringWithLink() {
|
||||
@@ -349,7 +349,7 @@ class AttributedStringBuilderTests: XCTestCase {
|
||||
}
|
||||
|
||||
let coalescedComponents = attributedString.formattedComponents
|
||||
XCTAssertEqual(coalescedComponents.count, 3)
|
||||
XCTAssertEqual(coalescedComponents.count, 1)
|
||||
|
||||
guard let component = coalescedComponents.first else {
|
||||
XCTFail("Could not get the first component")
|
||||
|
||||
Reference in New Issue
Block a user