@@ -15,34 +15,34 @@ var Link = exports.Link = function () {
15
15
this . targetName = "" ;
16
16
17
17
this . target = function ( targetName ) {
18
- if ( defined ( targetName ) ) this . targetName = targetName ;
18
+ if ( targetName !== undefined ) this . targetName = targetName ;
19
19
return this ;
20
20
}
21
21
this . inner = function ( inner ) {
22
- if ( defined ( inner ) ) this . innerName = inner ;
22
+ if ( inner !== undefined ) this . innerName = inner ;
23
23
return this ;
24
24
}
25
25
this . withText = function ( text ) {
26
- if ( defined ( text ) ) this . text = text ;
26
+ if ( text !== undefined ) this . text = text ;
27
27
return this ;
28
28
}
29
29
this . toSrc = function ( filename ) {
30
- if ( defined ( filename ) ) {
30
+ if ( filename !== undefined ) {
31
31
this . src = filename ;
32
32
this . text = filename ;
33
33
}
34
34
return this ;
35
35
}
36
36
this . toSymbol = function ( alias ) {
37
- if ( defined ( alias ) ) this . alias = new String ( alias ) ;
37
+ if ( alias !== undefined ) this . alias = alias . toString ( ) ;
38
38
return this ;
39
39
}
40
40
this . toClass = function ( alias ) {
41
41
this . classLink = true ;
42
42
return this . toSymbol ( alias ) ;
43
43
}
44
44
this . toFile = function ( file ) {
45
- if ( defined ( file ) ) this . file = file ;
45
+ if ( file !== undefined ) this . file = file ;
46
46
return this ;
47
47
}
48
48
@@ -59,7 +59,7 @@ var Link = exports.Link = function () {
59
59
thisLink . alias = symbolNames [ i ] ;
60
60
links . push ( thisLink . _makeSymbolLink ( symbolNames [ i ] ) ) ;
61
61
}
62
- return prematch + links . join ( "|" ) + postmatch ;
62
+ return prematch + links . join ( "|" ) + postmatch ;
63
63
}
64
64
) ;
65
65
}
@@ -128,15 +128,12 @@ Link.prototype._makeSymbolLink = function(alias) {
128
128
129
129
/** Create a link to a source file. */
130
130
Link . prototype . _makeSrcLink = function ( srcFilePath ) {
131
- var target = ( this . targetName ) ? " target=\"" + this . targetName + "\"" : "" ;
132
-
131
+ var target = ( this . targetName ) ? ' target="' + this . targetName + '"' : '' ;
133
132
// transform filepath into a filename
134
133
var srcFile = srcFilePath . replace ( / \. \. ? [ \\ \/ ] / g, "" ) . replace ( / [: \\ \/ ] / g, "_" ) ;
135
- var outFilePath = Link . base + Link . srcDir + srcFile + Link . ext ;
136
-
137
-
134
+ var outFilePath = Link . srcDir . join ( srcFile + Link . ext ) ;
138
135
//if (!this.text) this.text = FilePath.fileName(srcFilePath);
139
- return " <a href=\"" + outFilePath + "\"" + target + ">" + this . text + " </a>" ;
136
+ return ' <a href="--' + outFilePath + '"' + target + '>' + this . text + ' </a>' ;
140
137
}
141
138
142
139
/** Create a link to a source file. */
@@ -147,4 +144,8 @@ Link.prototype._makeFileLink = function(filePath) {
147
144
148
145
if ( ! this . text ) this . text = filePath ;
149
146
return "<a href=\"" + outFilePath + "\"" + target + ">" + this . text + "</a>" ;
147
+ }
148
+
149
+ exports . link = function link ( ) {
150
+
150
151
}
0 commit comments