Update react-docgen and ignore pages with no header

This commit is contained in:
Felix Kling
2015-02-18 16:39:28 -08:00
parent 022696c345
commit 472c287cd3
12 changed files with 564 additions and 246 deletions

View File

@@ -14,7 +14,8 @@ function splitHeader(content) {
}
}
return {
header: lines.slice(1, i + 1).join('\n'),
header: i < lines.length - 1 ?
lines.slice(1, i + 1).join('\n') : null,
content: lines.slice(i + 1).join('\n')
};
}
@@ -47,6 +48,9 @@ function execute() {
// Extract markdown metadata header
var both = splitHeader(content);
if (!both.header) {
return;
}
var lines = both.header.split('\n');
for (var i = 0; i < lines.length - 1; ++i) {
var keyvalue = lines[i].split(':');