diff --git a/ElementX/Sources/Other/HTMLParsing/AttributedStringBuilderV2.swift b/ElementX/Sources/Other/HTMLParsing/AttributedStringBuilderV2.swift
index 71d7d4076..4f50b7f36 100644
--- a/ElementX/Sources/Other/HTMLParsing/AttributedStringBuilderV2.swift
+++ b/ElementX/Sources/Other/HTMLParsing/AttributedStringBuilderV2.swift
@@ -164,6 +164,14 @@ struct AttributedStringBuilderV2: AttributedStringBuilderProtocol {
content.setFontPreservingSymbolicTraits(UIFont.monospacedSystemFont(ofSize: UIFont.systemFontSize, weight: .regular))
content.addAttribute(.backgroundColor, value: UIColor.compound._bgCodeBlock as Any, range: NSRange(location: 0, length: content.length))
+ // Don't allow identifiers in code blocks
+ content.removeAttribute(.MatrixRoomID, range: NSRange(location: 0, length: content.length))
+ content.removeAttribute(.MatrixRoomAlias, range: NSRange(location: 0, length: content.length))
+ content.removeAttribute(.MatrixUserID, range: NSRange(location: 0, length: content.length))
+ content.removeAttribute(.MatrixEventOnRoomID, range: NSRange(location: 0, length: content.length))
+ content.removeAttribute(.MatrixEventOnRoomAlias, range: NSRange(location: 0, length: content.length))
+ content.removeAttribute(.MatrixAllUsersMention, range: NSRange(location: 0, length: content.length))
+
case "hr":
content = NSMutableAttributedString(string: "\n")