Skip to content

Commit

Permalink
Improve debugging output for HtmlRelations
Browse files Browse the repository at this point in the history
  • Loading branch information
Munter committed Feb 8, 2017
1 parent 6b8c82e commit b0e6812
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/relationDebugDescription.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,16 @@ module.exports = function relationDebugDescription(relation) {

var offsets = [linesBefore.length, charsBefore.length + 1].join(':');

var details;

if (asset.type === 'Html') {
details = relation.node.outerHTML.replace(relation.node.innerHTML, '...');
}

if (asset.url.indexOf('file:') === 0) {
return [asset.urlOrDescription, offsets].join(':');
return [asset.urlOrDescription, offsets].join(':') + ' ' + details;
} else {
return asset.urlOrDescription + ' (' + offsets + ')';
return asset.urlOrDescription + ' (' + offsets + ') ' + details;
}
}

Expand Down

0 comments on commit b0e6812

Please sign in to comment.