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];
+1 -2
View File
@@ -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
View File
@@ -7,3 +7,10 @@ var showFile = function(txt) {
return;
}
var test=function(txt) {
SyntaxHighlighter.defaults['toolbar'] = false;
SyntaxHighlighter.highlight();
return;
}