Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b26acb7

Browse files
line note 不能正常显示的 bug
1 parent c7ac0d6 commit b26acb7

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

‎Coding_iOS/Controllers/FileChangeDetailViewController.m‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ - (void)refresh{
7070
- (void)refreshUI{
7171
if (self.rawData) {
7272
NSData *JSONDataRaw = [NSJSONSerialization dataWithJSONObject:self.rawData options:NSJSONWritingPrettyPrinted error:nil];
73-
NSString *contentStr = [[NSString alloc] initWithData:JSONDataRaw encoding:NSUTF8StringEncoding];
73+
NSString *contentStr = [[[NSString alloc] initWithData:JSONDataRaw encoding:NSUTF8StringEncoding] stringByRemoveSpecailCharacters];
7474

7575
NSData *JSONDataComments = [NSJSONSerialization dataWithJSONObject:self.commentsData options:NSJSONWritingPrettyPrinted error:nil];
76-
NSString *commentsStr = [[NSString alloc] initWithData:JSONDataComments encoding:NSUTF8StringEncoding];
76+
NSString *commentsStr = [[[NSString alloc] initWithData:JSONDataComments encoding:NSUTF8StringEncoding] stringByRemoveSpecailCharacters];
7777

7878
contentStr = [WebContentManager diffPatternedWithContent:contentStr andComments:commentsStr];
7979
[self.webContentView loadHTMLString:contentStr baseURL:nil];

‎Coding_iOS/Util/OC_Category/NSString+Common.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636

3737
+ (NSString *)sizeDisplayWithByte:(CGFloat)sizeOfByte;
3838

39+
- (NSString *)stringByRemoveSpecailCharacters;
3940
- (NSString *)trimWhitespace;
4041
- (BOOL)isEmpty;
4142
- (BOOL)isEmptyOrListening;

‎Coding_iOS/Util/OC_Category/NSString+Common.m‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,15 @@ + (NSString *)sizeDisplayWithByte:(CGFloat)sizeOfByte{
301301
return sizeDisplayStr;
302302
}
303303

304+
- (NSString *)stringByRemoveSpecailCharacters{
305+
static NSCharacterSet *specailCharacterSet;
306+
if (!specailCharacterSet) {
307+
NSMutableString *specailCharacters = @"\u2028\u2029".mutableCopy;
308+
specailCharacterSet = [NSCharacterSet characterSetWithCharactersInString:specailCharacters];
309+
}
310+
return [[self componentsSeparatedByCharactersInSet:specailCharacterSet] componentsJoinedByString:@""];
311+
}
312+
304313
- (NSString *)trimWhitespace
305314
{
306315
NSMutableString *str = [self mutableCopy];

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /