summaryrefslogtreecommitdiff
path: root/Juick/Views/MessageCell.m
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-11-12 18:51:38 +0300
committerGravatar Vitaly Takmazov2018-11-12 18:51:38 +0300
commit97d8f218fbd2903cea5d40313c9e6d24558708e3 (patch)
tree01391710c9e3bc9fa90e117a5e05e39b9ccdbd1e /Juick/Views/MessageCell.m
parent0c35d513f852d40d8c6c382e2750373b57afe0cd (diff)
Fix quote paragraph style
Diffstat (limited to 'Juick/Views/MessageCell.m')
-rw-r--r--Juick/Views/MessageCell.m7
1 files changed, 6 insertions, 1 deletions
diff --git a/Juick/Views/MessageCell.m b/Juick/Views/MessageCell.m
index f9c9746..b9e40c8 100644
--- a/Juick/Views/MessageCell.m
+++ b/Juick/Views/MessageCell.m
@@ -75,7 +75,7 @@
if (msg.text) {
NSMutableAttributedString *txt = [[NSMutableAttributedString alloc]
initWithString:
- [[msg.text stringByDecodingHTMLEntities] stringByReplacingOccurrencesOfString:@"\n" withString:@"\r\n"]
+ [msg.text stringByDecodingHTMLEntities]
attributes:@{NSFontAttributeName:[UIFont preferredFontForTextStyle:UIFontTextStyleBody]}];
[txt beginEditing];
for (NSDictionary *entity in msg.entities) {
@@ -88,6 +88,11 @@
}
if ([[entity objectForKey:@"type"] isEqualToString:@"q"]) {
[txt addAttribute:NSForegroundColorAttributeName value:[UIColor darkGrayColor] range:currentRange];
+ NSMutableParagraphStyle *paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
+ paragraphStyle.firstLineHeadIndent = 12.0f;
+ paragraphStyle.headIndent = 12.0f;
+ paragraphStyle.paragraphSpacing = 12.0f;
+ [txt addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:currentRange];
}
if ([[entity objectForKey:@"type"] isEqualToString:@"u"]) {
[txt addAttribute:NSUnderlineStyleAttributeName value:@(NSUnderlineStyleSingle) range:currentRange];