Skip to content

Commit 691a7c0

Browse files
authored
fix: selecting migrated notes
* fix: selecting migrated notes * perf: reduce re-rendering of notes when activating one * chore: apply tiny fixes * fix: name of handler
1 parent e87b1ae commit 691a7c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

shared/links-metadata/src/migrate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export function migrateBlock(
9191
const relativePosition = sourceSiblingBlocks.indexOf(sourceBlock) / (sourceSiblingBlocks.length - 1);
9292

9393
const targetLineNumber =
94-
sourceBlock.line && sourceLines[sourceBlock.line - 1].startsWith("\\end")
94+
sourceBlock.line && (sourceLines[sourceBlock.line - 1]?.startsWith("\\end") ?? false)
9595
? findMultiLineMatch(sourceLines, sourceBlock.line, targetContent)
9696
: findSingleLineMatch(findFirstNonEmptyLineUpwards(sourceLines, sourceBlock.line), targetContent);
9797

0 commit comments

Comments
 (0)