diff options
author | Samy Pesse <samypesse@gmail.com> | 2016-02-12 19:20:32 +0100 |
---|---|---|
committer | Samy Pesse <samypesse@gmail.com> | 2016-02-12 19:20:32 +0100 |
commit | 4555c541a8f98cb6ad4cbec2d7bf85b375dbf505 (patch) | |
tree | 0079507e1885a6c8a94a36644650a865f5e8cc5d /lib/utils/path.js | |
parent | a853a51a0ba0976e8e28f368bd88717611b3c477 (diff) | |
download | gitbook-4555c541a8f98cb6ad4cbec2d7bf85b375dbf505.zip gitbook-4555c541a8f98cb6ad4cbec2d7bf85b375dbf505.tar.gz gitbook-4555c541a8f98cb6ad4cbec2d7bf85b375dbf505.tar.bz2 |
Replace links to page of summary by html links
Diffstat (limited to 'lib/utils/path.js')
-rw-r--r-- | lib/utils/path.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/utils/path.js b/lib/utils/path.js index f195d6c..c233c92 100644 --- a/lib/utils/path.js +++ b/lib/utils/path.js @@ -42,8 +42,17 @@ function resolveInRoot(root) { return result; } +// Chnage extension +function setExtension(filename, ext) { + return path.join( + path.dirname(filename), + path.basename(filename, path.extname(filename)) + ext + ); +} + module.exports = { isInRoot: isInRoot, resolveInRoot: resolveInRoot, - normalize: normalizePath + normalize: normalizePath, + setExtension: setExtension }; |