From 698aeb56403a2eba1f737e827921d867edf60589 Mon Sep 17 00:00:00 2001 From: emsquared Date: Thu, 26 Jul 2012 12:26:37 -0400 Subject: [PATCH] Remove all newlines instead of only trimming them. --- Classes/Headers/NSStringHelper.h | 2 ++ Classes/Helpers/Cocoa (Objective-C)/NSStringHelper.m | 5 +++++ Classes/Views/Channel View/LVCLogRenderer.m | 6 +++--- Resources/Info.plist | 4 ++-- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Classes/Headers/NSStringHelper.h b/Classes/Headers/NSStringHelper.h index f4b8aa3664..1af119080e 100755 --- a/Classes/Headers/NSStringHelper.h +++ b/Classes/Headers/NSStringHelper.h @@ -85,6 +85,8 @@ - (NSString *)trim; - (NSString *)trimNewlines; +- (NSString *)removeAllNewlines; + - (id)attributedStringWithIRCFormatting:(NSFont *)defaultFont followFormattingPreference:(BOOL)formattingPreference; - (id)attributedStringWithIRCFormatting:(NSFont *)defaultFont; diff --git a/Classes/Helpers/Cocoa (Objective-C)/NSStringHelper.m b/Classes/Helpers/Cocoa (Objective-C)/NSStringHelper.m index 0e4df5ba3d..53e0c6a2b9 100755 --- a/Classes/Helpers/Cocoa (Objective-C)/NSStringHelper.m +++ b/Classes/Helpers/Cocoa (Objective-C)/NSStringHelper.m @@ -182,6 +182,11 @@ - (NSString *)trimNewlines return [self stringByTrimmingCharactersInSet:[NSCharacterSet newlineCharacterSet]]; } +- (NSString *)removeAllNewlines +{ + return [self stringByReplacingOccurrencesOfString:NSStringNewlinePlaceholder withString:NSStringEmptyPlaceholder]; +} + - (BOOL)isNumericOnly { NSUInteger len = self.length; diff --git a/Classes/Views/Channel View/LVCLogRenderer.m b/Classes/Views/Channel View/LVCLogRenderer.m index 8055f246fa..b0c1bee699 100755 --- a/Classes/Views/Channel View/LVCLogRenderer.m +++ b/Classes/Views/Channel View/LVCLogRenderer.m @@ -201,7 +201,7 @@ NSInteger mapColorValue(NSColor *color) NSString *aHtml = [tmpl renderObject:templateTokens]; if (NSObjectIsNotEmpty(aHtml)) { - return aHtml; + return aHtml.removeAllNewlines; } } @@ -323,7 +323,7 @@ NSInteger mapColorValue(NSColor *color) } // --- // - + return TXRenderStyleTemplate(@"formattedMessageFragment", templateTokens, log); } } @@ -801,7 +801,7 @@ + (NSString *)renderBody:(NSString *)body } else { NSString *renderedRange = renderRange(body, t, start, n, log); - [result appendString:renderedRange.trimNewlines]; + [result appendString:renderedRange]; } start += n; diff --git a/Resources/Info.plist b/Resources/Info.plist index 21572cf490..32cde08e54 100755 --- a/Resources/Info.plist +++ b/Resources/Info.plist @@ -47,8 +47,8 @@ TXBundleBuildCodeName Turtle Soup TXBundleBuildNumber - 12096 + 12099 TXBundleBuildReference - 2.1.1-255-g0848951-debug,llvm4.0 + 2.1.1-256-g0a72d38-debug,llvm4.0