mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
html and code parse errors...
This commit is contained in:
+9
-2
@@ -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:@"<"];
|
||||
txt=[txt stringByReplacingOccurrencesOfString:@">" withString:@">"];
|
||||
|
||||
return txt;
|
||||
}
|
||||
|
||||
- (NSString *) parseBlame:(NSString *)txt
|
||||
{
|
||||
txt=[self parseHTML:txt];
|
||||
|
||||
NSArray *lines = [txt componentsSeparatedByString:@"\n"];
|
||||
NSString *line;
|
||||
NSMutableDictionary *headers=[NSMutableDictionary dictionary];
|
||||
|
||||
@@ -40,8 +40,7 @@ SyntaxHighlighter.brushes.ObjC = function()
|
||||
|
||||
this.regexList = [
|
||||
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
|
||||
{ regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, // multiline comments
|
||||
{ regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments
|
||||
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
|
||||
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
|
||||
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
|
||||
{ regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers
|
||||
|
||||
@@ -7,3 +7,10 @@ var showFile = function(txt) {
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
var test=function(txt) {
|
||||
SyntaxHighlighter.defaults['toolbar'] = false;
|
||||
SyntaxHighlighter.highlight();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user