html and code parse errors...

This commit is contained in:
German Laullon
2010-09-19 12:17:18 -07:00
parent 6d564bb463
commit bcee4aa91e
3 changed files with 17 additions and 4 deletions
+9 -2
View File
@@ -68,7 +68,7 @@
NSString *fileTxt=@"";
if(startFile==@"fileview")
fileTxt=[file textContents];
fileTxt=[self parseHTML:[file textContents]];
else if(startFile==@"blame")
fileTxt=[self parseBlame:[file blame]];
else if(startFile==@"log")
@@ -145,11 +145,18 @@
[self showFile];
}
- (NSString *) parseBlame:(NSString *)txt
- (NSString *) parseHTML:(NSString *)txt
{
txt=[txt stringByReplacingOccurrencesOfString:@"<" withString:@"&lt;"];
txt=[txt stringByReplacingOccurrencesOfString:@">" withString:@"&gt;"];
return txt;
}
- (NSString *) parseBlame:(NSString *)txt
{
txt=[self parseHTML:txt];
NSArray *lines = [txt componentsSeparatedByString:@"\n"];
NSString *line;
NSMutableDictionary *headers=[NSMutableDictionary dictionary];