We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e87b1ae commit 691a7c0Copy full SHA for 691a7c0
shared/links-metadata/src/migrate.ts
@@ -91,7 +91,7 @@ export function migrateBlock(
91
const relativePosition = sourceSiblingBlocks.indexOf(sourceBlock) / (sourceSiblingBlocks.length - 1);
92
93
const targetLineNumber =
94
- sourceBlock.line && sourceLines[sourceBlock.line - 1].startsWith("\\end")
+ sourceBlock.line && (sourceLines[sourceBlock.line - 1]?.startsWith("\\end") ?? false)
95
? findMultiLineMatch(sourceLines, sourceBlock.line, targetContent)
96
: findSingleLineMatch(findFirstNonEmptyLineUpwards(sourceLines, sourceBlock.line), targetContent);
97
0 commit comments