Skip to content

Commit bcee4aa

Browse files
committed
html and code parse errors...
1 parent 6d564bb commit bcee4aa

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

GLFileView.m

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ - (void) showFile
6868

6969
NSString *fileTxt=@"";
7070
if(startFile==@"fileview")
71-
fileTxt=[file textContents];
71+
fileTxt=[self parseHTML:[file textContents]];
7272
else if(startFile==@"blame")
7373
fileTxt=[self parseBlame:[file blame]];
7474
else if(startFile==@"log")
@@ -145,11 +145,18 @@ - (void) didLoad
145145
[self showFile];
146146
}
147147

148-
- (NSString *) parseBlame:(NSString *)txt
148+
- (NSString *) parseHTML:(NSString *)txt
149149
{
150150
txt=[txt stringByReplacingOccurrencesOfString:@"<" withString:@"&lt;"];
151151
txt=[txt stringByReplacingOccurrencesOfString:@">" withString:@"&gt;"];
152152

153+
return txt;
154+
}
155+
156+
- (NSString *) parseBlame:(NSString *)txt
157+
{
158+
txt=[self parseHTML:txt];
159+
153160
NSArray *lines = [txt componentsSeparatedByString:@"\n"];
154161
NSString *line;
155162
NSMutableDictionary *headers=[NSMutableDictionary dictionary];

html/lib/syntaxhighlighter_2.1.364/scripts/shBrushObjC.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ SyntaxHighlighter.brushes.ObjC = function()
4040

4141
this.regexList = [
4242
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
43-
{ regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, // multiline comments
44-
{ regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments
43+
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
4544
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
4645
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
4746
{ regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers

html/views/fileview/fileview.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,10 @@ var showFile = function(txt) {
77

88
return;
99
}
10+
11+
var test=function(txt) {
12+
SyntaxHighlighter.defaults['toolbar'] = false;
13+
SyntaxHighlighter.highlight();
14+
15+
return;
16+
}

0 commit comments

Comments
 (0)