Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Commit

Permalink
Follow symlinks when resolving css paths
Browse files Browse the repository at this point in the history
  • Loading branch information
scf2k committed Oct 23, 2014
1 parent 5ff24eb commit e35afa8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/coverage/index.js
Expand Up @@ -2,6 +2,7 @@

var inherit = require('inherit'),
path = require('path'),
fs = require('fs'),
url = require('url'),
q = require('q'),
qfs = require('q-io/fs'),
Expand Down Expand Up @@ -185,9 +186,12 @@ module.exports = inherit({

var sourceStart = getPosition(rule.position.start, opts.file, opts.map),
sourceEnd = getPosition(rule.position.end, opts.file, opts.map),
src = sourceStart.source?
path.relative(this.config.sourceRoot, path.resolve(opts.docDir, sourceStart.source)) :
opts.file.replace(this.config.rootUrl, '').replace(/^\//, '');
src = path.relative(
this.config.sourceRoot,
fs.realpathSync(sourceStart.source?
path.resolve(opts.docDir, sourceStart.source) :
opts.file.replace(this.config.rootUrl, '').replace(/^\//, ''))
);

var blocks = (opts.out[src] = opts.out[src] || {}),
posKey = sourceStart.line + ':' + sourceStart.column + ':' + sourceEnd.line + ':' + sourceEnd.column,
Expand Down

0 comments on commit e35afa8

Please sign in to comment.