mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
refactor(docs-infra): extract only the visibleRegion
Previously we extracted the regions and only made the visible region visible on the page, but since there is not a need for the
non-visible code to be presented, we don't need to include it in the generated code snippets.
(cherry picked from commit 9b3b5fb4cf)
This commit is contained in:
committed by
Pawel Kozlowski
parent
e95d2e3a34
commit
76f784c340
@@ -24,8 +24,6 @@ export function extractRegions(token: CodeToken) {
|
||||
if (!region) {
|
||||
throw new Error(`Cannot find ${token.visibleRegion} in ${token.path}!`);
|
||||
}
|
||||
token.visibleLines = `[${region.ranges.map(
|
||||
(range) => `[${range.from}, ${range.to ?? parsedRegions.totalLinesCount + 1}]`,
|
||||
)}]`;
|
||||
token.code = region.lines.join('\n');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user