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:
Doug
2026-01-28 11:46:13 +00:00
committed by GitHub
parent 3d5269fa19
commit fa200cfedb
67 changed files with 324 additions and 83 deletions
@@ -68,6 +68,11 @@ enum CodeBlockAttribute: AttributedStringKey {
static let name = "MXCodeBlockAttribute"
}
enum InlineCodeAttribute: AttributedStringKey {
typealias Value = Bool
static let name = "MXInlineCodeAttribute"
}
// periphery: ignore - required to make NSAttributedString to AttributedString conversion even if not used directly
extension AttributeScopes {
struct ElementXAttributes: AttributeScope {
@@ -84,6 +89,7 @@ extension AttributeScopes {
let allUsersMention: AllUsersMentionAttribute
let codeBlock: CodeBlockAttribute
let inlineCode: InlineCodeAttribute
let swiftUI: SwiftUIAttributes
let uiKit: UIKitAttributes