Preserve UTF-8 BOMs during Vault ingestion

This commit is contained in:
vorotamoroz
2026-07-31 01:08:56 +00:00
parent b21c3114e5
commit e296708845
2 changed files with 39 additions and 1 deletions
@@ -10,7 +10,8 @@ export class ObsidianVaultAdapter implements IVaultAdapter<TFile, TFolder> {
constructor(private app: App) {}
async read(file: TFile): Promise<string> {
return await this.app.vault.read(file);
// Vault.read strips a leading UTF-8 BOM, leaving the content size inconsistent with TFile.stat.
return await this.app.vault.adapter.read(file.path);
}
async cachedRead(file: TFile): Promise<string> {