Skip to content

Commit 17beca9

Browse files
committed
Fix syntax errors
1 parent 50b6d93 commit 17beca9

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

lib/section2obj.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var _ = require('lodash');
22

33
var langs = require('./langs');
44

5-
function section2obj {
5+
function section2obj(section) {
66
var nonCodeNodes = _.reject(section, {
77
'type': 'code'
88
});
@@ -12,17 +12,17 @@ function section2obj {
1212
});
1313

1414
// Languages in code blocks
15-
var langs = _.pluck(codeNodes, 'lang').map(langs.normalize);
15+
var _langs = _.pluck(codeNodes, 'lang').map(langs.normalize);
1616

1717
// Check that they are all the same
18-
var validLangs = _.all(_.map(langs, function(lang) {
18+
var validLangs = _.all(_.map(_langs, function(lang) {
1919
return lang && lang === langs[0];
2020
}));
2121

2222
// Main language
23-
var lang = validLangs ? langs[0] : null;
23+
var lang = validLangs ? _langs[0] : null;
2424

25-
return {,
25+
return {
2626
content: nonCodeNodes,
2727
lang: lang,
2828
code: {

lib/sections.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ var _ = require('lodash');
44
function split(nodes) {
55
var section = [];
66

7-
return _(nodes)
8-
.reduce(, function(sections, el) {
7+
return _.chain(nodes)
8+
.reduce(function(sections, el) {
99
if(el.type === 'hr') {
1010
sections.push(section);
1111
section = [];
@@ -28,7 +28,7 @@ function join(sections) {
2828
var nodes = _.reduce(sections, function(nodes, section) {
2929
return nodes.concat(section);
3030
}, []);
31-
nodes.links = (sections[0] && (sections[0].links) || {};
31+
nodes.links = (sections[0] && (sections[0].links) || {});
3232
return nodes;
3333
}
3434

0 commit comments

Comments
 (0)