Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/generators/metadata/utils/parse.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,10 @@ export const parseApiDoc = ({ path, tree }, typeMap) => {
? tree.children.length
: tree.children.indexOf(nextHeadingNode);

// Create subtree for this section
const subTree = createTree('root', tree.children.slice(index, stop));
// Create subtree for this section. If it's the first entry, we start from the
// beginning of the tree to ensure top-level nodes (like YAML) are captured.
const startIndex = metadataCollection.length === 0 ? 0 : index;
const subTree = createTree('root', tree.children.slice(startIndex, stop));

visit(subTree, UNIST.isStabilityNode, node =>
visitStability(node, ignoreStability ? undefined : metadata)
Expand Down
Loading