summaryrefslogtreecommitdiffstats
path: root/lib/output/resolveFile.js
blob: a3a49c54ac4402bd1b016308e82e1c130b6f12c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
var PathUtils = require('../utils/path');

/**
    Resolve an absolute path (extracted from a link)

    @param {Output} output
    @param {String} filePath
    @return {String}
*/
function resolveFile(output, filePath) {
    var pages = output.getPages();
    var page = pages.get(filePath);

    if (!page) {
        return filePath;
    }

    return PathUtils.setExtension(filePath, '.html');
}

module.exports = resolveFile;