mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-26 23:05:00 +08:00
Update react-docgen and ignore pages with no header
This commit is contained in:
@@ -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(':');
|
||||
|
||||
Reference in New Issue
Block a user