From bcee4aa91eb3e0c7e6ca47eb25272c28f6f7f190 Mon Sep 17 00:00:00 2001 From: German Laullon Date: Sun, 19 Sep 2010 12:17:18 -0700 Subject: [PATCH] html and code parse errors... --- GLFileView.m | 11 +++++++++-- .../syntaxhighlighter_2.1.364/scripts/shBrushObjC.js | 3 +-- html/views/fileview/fileview.js | 7 +++++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/GLFileView.m b/GLFileView.m index aee67b9..bc7b0f3 100644 --- a/GLFileView.m +++ b/GLFileView.m @@ -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]; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushObjC.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushObjC.js index 2b93479..a1e7fd1 100644 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushObjC.js +++ b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushObjC.js @@ -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 diff --git a/html/views/fileview/fileview.js b/html/views/fileview/fileview.js index 2168e9e..a8abad6 100644 --- a/html/views/fileview/fileview.js +++ b/html/views/fileview/fileview.js @@ -7,3 +7,10 @@ var showFile = function(txt) { return; } + +var test=function(txt) { + SyntaxHighlighter.defaults['toolbar'] = false; + SyntaxHighlighter.highlight(); + + return; +}