Mark code blocks with a special attribute and strip away links from them.

This commit is contained in:
Stefan Ceriu
2025-09-09 13:59:06 +03:00
committed by Doug
parent 02462fb1a0
commit cd249040cd
5 changed files with 24 additions and 26 deletions
@@ -62,6 +62,11 @@ enum AllUsersMentionAttribute: AttributedStringKey {
static let name = "MXAllUsersMentionAttribute"
}
enum CodeBlockAttribute: AttributedStringKey {
typealias Value = Bool
static let name = "MXCodeBlockAttribute"
}
// periphery: ignore - required to make NSAttributedString to AttributedString conversion even if not used directly
extension AttributeScopes {
struct ElementXAttributes: AttributeScope {
@@ -77,6 +82,8 @@ extension AttributeScopes {
let allUsersMention: AllUsersMentionAttribute
let codeBlock: CodeBlockAttribute
let swiftUI: SwiftUIAttributes
let uiKit: UIKitAttributes
}