File tree Expand file tree Collapse file tree 3 files changed +17
-4
lines changed
lib/syntaxhighlighter_2.1.364/scripts Expand file tree Collapse file tree 3 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ - (void) showFile
68
68
69
69
NSString *fileTxt=@" " ;
70
70
if (startFile==@" fileview" )
71
- fileTxt=[file textContents ];
71
+ fileTxt=[self parseHTML: [ file textContents ] ];
72
72
else if (startFile==@" blame" )
73
73
fileTxt=[self parseBlame: [file blame ]];
74
74
else if (startFile==@" log" )
@@ -145,11 +145,18 @@ - (void) didLoad
145
145
[self showFile ];
146
146
}
147
147
148
- - (NSString *) parseBlame : (NSString *)txt
148
+ - (NSString *) parseHTML : (NSString *)txt
149
149
{
150
150
txt=[txt stringByReplacingOccurrencesOfString: @" <" withString: @" <" ];
151
151
txt=[txt stringByReplacingOccurrencesOfString: @" >" withString: @" >" ];
152
152
153
+ return txt;
154
+ }
155
+
156
+ - (NSString *) parseBlame : (NSString *)txt
157
+ {
158
+ txt=[self parseHTML: txt];
159
+
153
160
NSArray *lines = [txt componentsSeparatedByString: @" \n " ];
154
161
NSString *line;
155
162
NSMutableDictionary *headers=[NSMutableDictionary dictionary ];
Original file line number Diff line number Diff line change @@ -40,8 +40,7 @@ SyntaxHighlighter.brushes.ObjC = function()
40
40
41
41
this . regexList = [
42
42
{ 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
45
44
{ regex : SyntaxHighlighter . regexLib . doubleQuotedString , css : 'string' } , // strings
46
45
{ regex : SyntaxHighlighter . regexLib . singleQuotedString , css : 'string' } , // strings
47
46
{ regex : / \b ( [ \d ] + ( \. [ \d ] + ) ? | 0 x [ a - f 0 - 9 ] + ) \b / gi, css : 'value' } , // numbers
Original file line number Diff line number Diff line change @@ -7,3 +7,10 @@ var showFile = function(txt) {
7
7
8
8
return ;
9
9
}
10
+
11
+ var test = function ( txt ) {
12
+ SyntaxHighlighter . defaults [ 'toolbar' ] = false ;
13
+ SyntaxHighlighter . highlight ( ) ;
14
+
15
+ return ;
16
+ }
You can’t perform that action at this time.
0 commit comments