mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Make rich messages editable via InstantPage↔markdown round-trip
Reconstruct markdown source from a stored InstantPage to populate the edit field, then re-classify on save (the inverse of the send path). Adds the InstantPageToMarkdown converter, edit-field population and save-time re-classification in ChatControllerLoadDisplayNode, and a shared InstantPage previewText surfaced through MessageContentKind for reply/pinned/forward previews. Documented in CLAUDE.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
e1b48665a8
commit
a9f8b0d067
6 changed files with 483 additions and 181 deletions
|
|
@ -309,6 +309,11 @@ public func messageContentKind(contentSettings: ContentSettings, message: Engine
|
|||
return kind
|
||||
}
|
||||
}
|
||||
for attribute in message.attributes {
|
||||
if let attribute = attribute as? RichTextMessageAttribute {
|
||||
return .text(NSAttributedString(string: attribute.instantPage.previewText()))
|
||||
}
|
||||
}
|
||||
return .text(messageTextWithAttributes(message: message))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue