Files
ichmagmaus111andClaude Opus 5.5 0622057a4f Ghostgram: open-source release
Ghostgram for iOS, rebuilt from scratch on Telegram iOS 13.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 17:57:09 +01:00

14 lines
805 B
Swift

import Foundation
import UIKit
import TelegramStringFormatting
import TextFormat
func chatListRichTextPreview(_ preview: NSAttributedString, font: UIFont, italicFont: UIFont, textColor: UIColor, additionalSpoilers: [NSRange]) -> NSAttributedString {
let result = NSMutableAttributedString(attributedString: styleInstantPagePreview(preview, font: font, italicFont: italicFont, textColor: textColor))
for range in additionalSpoilers {
guard range.location >= 0, range.location <= result.length, range.length > 0, range.length <= result.length - range.location else { continue }
result.addAttribute(NSAttributedString.Key(rawValue: TelegramTextAttributes.Spoiler), value: true, range: range)
}
return renderInstantPagePreviewIcons(result, font: font, textColor: textColor)
}