Books/fix relative links (#7083)

* fix to make relative links work on untitled notebooks

* changes to make the preb/next links to work

* show filename with extension
This commit is contained in:
Maddy
2019-09-10 09:43:00 -07:00
committed by GitHub
parent 4dda5ee549
commit ab8a9509b8
3 changed files with 20 additions and 12 deletions

View File

@@ -226,6 +226,8 @@ export class NotebookMarkdownRenderer {
return base.replace(/:[\s\S]*/, ':') + href;
} else if (href.charAt(0) === '/') {
return base.replace(/(:\/*[^/]*)[\s\S]*/, '$1') + href;
} else if (href.slice(0, 2) === '..') {
return path.join(base, href);
} else {
return base + href;
}