Skip to content

Commit

Permalink
Remove all newlines instead of only trimming them.
Browse files Browse the repository at this point in the history
  • Loading branch information
emsquared committed Jul 26, 2012
1 parent 0a72d38 commit 698aeb5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 2 additions & 0 deletions Classes/Headers/NSStringHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@
- (NSString *)trim;
- (NSString *)trimNewlines;

- (NSString *)removeAllNewlines;

- (id)attributedStringWithIRCFormatting:(NSFont *)defaultFont followFormattingPreference:(BOOL)formattingPreference;
- (id)attributedStringWithIRCFormatting:(NSFont *)defaultFont;

Expand Down
5 changes: 5 additions & 0 deletions Classes/Helpers/Cocoa (Objective-C)/NSStringHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions Classes/Views/Channel View/LVCLogRenderer.m
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ NSInteger mapColorValue(NSColor *color)
NSString *aHtml = [tmpl renderObject:templateTokens];

if (NSObjectIsNotEmpty(aHtml)) {
return aHtml;
return aHtml.removeAllNewlines;
}
}

Expand Down Expand Up @@ -323,7 +323,7 @@ NSInteger mapColorValue(NSColor *color)
}

// --- //

return TXRenderStyleTemplate(@"formattedMessageFragment", templateTokens, log);
}
}
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
<key>TXBundleBuildCodeName</key>
<string>Turtle Soup</string>
<key>TXBundleBuildNumber</key>
<string>12096</string>
<string>12099</string>
<key>TXBundleBuildReference</key>
<string>2.1.1-255-g0848951-debug,llvm4.0</string>
<string>2.1.1-256-g0a72d38-debug,llvm4.0</string>
</dict>
</plist>

0 comments on commit 698aeb5

Please sign in to comment.