Skip to content

Commit

Permalink
bump source-fragment and use collapseOffset option
Browse files Browse the repository at this point in the history
  • Loading branch information
lahmatiy committed Oct 27, 2017
1 parent c97b1ce commit e50d2f7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function fail(res, code, message) {

module.exports = function(options) {
var cwd = path.resolve((options && options.cwd) || process.cwd());
return function openInEditor(req, res, next) {
return function sourceFragment(req, res, next) {
var queryLoc = url.parse(req.url, true).query.loc;
var loc;

Expand All @@ -31,7 +31,10 @@ module.exports = function(options) {
try {
res.statusCode = 200;
res.set('Content-Type', 'text/html; charset=utf-8');
res.end(sf(loc, { format: 'html' }));
res.end(sf(loc, {
format: 'html',
collapseOffset: true
}));
} catch (e) {
fail(res, 500, 'ERROR: ' + e);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"README.md"
],
"dependencies": {
"source-fragment": "^1.0.0"
"source-fragment": "^1.1.0"
},
"scripts": {
"test": "mocha --reporter dot",
Expand Down

0 comments on commit e50d2f7

Please sign in to comment.