mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-22 18:43:29 +00:00
Fix URL creation on windows
This commit is contained in:
@@ -46,16 +46,11 @@ GitBookRenderer.prototype.link = function(href, title, text) {
|
||||
var o = this._extra_options;
|
||||
// Relative link, rewrite it to point to github repo
|
||||
if(!parsed.protocol && parsed.path && parsed.path[0] != '/' && o && o.repo && o.dir) {
|
||||
href = 'https://github.com/' + o.repo + '/blob' + path.normalize(path.join(
|
||||
'/',
|
||||
o.dir,
|
||||
href
|
||||
));
|
||||
parsed = url.parse(href);
|
||||
parsed = url.parse('https://github.com/' + o.repo + '/blob/').resolveObject([o.dir, href].join("/"));
|
||||
}
|
||||
|
||||
// Generate HTML for link
|
||||
var out = '<a href="' + href + '"';
|
||||
var out = '<a href="' + parsed.href + '"';
|
||||
// Title if no null
|
||||
if (title) {
|
||||
out += ' title="' + title + '"';
|
||||
|
||||
Reference in New Issue
Block a user