Skip to content

Commit 853679b

Browse files
committed
fix: Examples can also be terminated by the end of a file
1 parent 759b3b7 commit 853679b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/domain/exampleExtractor.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,16 @@ export const extractExampleSections = (
6464
}
6565
}
6666
});
67+
68+
// An in-progress example is also terminated by the end of the file
69+
if (partialExample !== undefined) {
70+
sections.push({
71+
name: partialExample.name,
72+
contents: partialExample.lines.join('\n'),
73+
context,
74+
});
75+
}
76+
6777
// end-example
6878
if (sections.length === 0) {
6979
logger.debug(`No example sections in ${context.fullPath}`);

0 commit comments

Comments
 (0)