Various improvements

This commit is contained in:
Ali
2023-10-26 13:57:17 +04:00
parent 44e737d837
commit f11a98e489
3 changed files with 13 additions and 29 deletions

View File

@@ -200,17 +200,17 @@ public func stringWithAppliedEntities(_ text: String, entities: [MessageTextEnti
}
string.addAttribute(NSAttributedString.Key(rawValue: TelegramTextAttributes.BotCommand), value: nsString!.substring(with: range), range: range)
case .Pre:
string.addAttribute(NSAttributedString.Key.font, value: fixedFont, range: range)
addFontAttributes(range, .monospace)
if nsString == nil {
nsString = text as NSString
}
string.addAttribute(NSAttributedString.Key(rawValue: TelegramTextAttributes.Pre), value: nsString!.substring(with: range), range: range)
case .Code:
string.addAttribute(NSAttributedString.Key.font, value: fixedFont, range: range)
addFontAttributes(range, .monospace)
if nsString == nil {
nsString = text as NSString
}
string.addAttribute(NSAttributedString.Key(rawValue: TelegramTextAttributes.Pre), value: nsString!.substring(with: range), range: range)
string.addAttribute(NSAttributedString.Key(rawValue: TelegramTextAttributes.Code), value: nsString!.substring(with: range), range: range)
case .BlockQuote:
addFontAttributes(range, .blockQuote)