Canonicalize source checkout line endings

This commit is contained in:
Meta Vens 2026-08-30 23:21:47 +02:00
commit b8e377278a
2 changed files with 9 additions and 5 deletions

View file

@ -433,11 +433,15 @@ function comparableFields(document: ArchivedSourceDocumentRecord): Record<string
path: document.path,
language: document.language,
title: document.title,
content: document.content,
content: canonicalizeLineEndings(document.content),
metadata: document.metadata ?? {},
};
}
function canonicalizeLineEndings(content: string): string {
return content.replace(/\r\n?/g, "\n");
}
function compareDocuments(
left: ArchivedSourceDocumentRecord,
right: ArchivedSourceDocumentRecord,