From 9ca299cafd915a43145a0bfb43acb9fb2d514d37 Mon Sep 17 00:00:00 2001 From: Alexander Kucera Date: Tue, 4 Nov 2025 10:57:24 +0100 Subject: [PATCH] Fixes bibliography errors Disables Pandoc's automatic citeproc filter to prevent errors when processing documents without a bibliography file. This resolves issues where Pandoc incorrectly detects citation-like patterns in markdown and attempts to generate bibliographies, leading to "document does not contain a bibliography" errors. --- CHANGELOG.md | 1 + src/converters/pandoc/PandocCommandBuilder.ts | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 002589e..91ddb8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - **Windows Absolute Path Handling**: Fixed ENOENT errors on Windows caused by improper path joining when combining vault paths with plugin directories. PathUtils.joinPath() now properly detects and handles absolute paths using path.isAbsolute() to prevent invalid path construction like `C:\MyVault\C:\MyVault\...` - **Remote URL Image Handling**: Fixed ENOENT errors when markdown contains remote image URLs. Remote images are now automatically downloaded and embedded, with graceful fallback to placeholder text if download fails +- **Bibliography Errors**: Fixed "document does not contain a bibliography" errors by disabling Pandoc's automatic citeproc filter. Pandoc was detecting citation-like patterns in markdown (such as wikilinks or certain frontmatter fields) and attempting to generate bibliographies without a bibliography file - **Cross-Platform Binary Discovery**: BinaryLocator now includes comprehensive fallback paths for different installation methods - **Vault-Relative Path Consistency**: Fixed all vault.adapter operations to use proper vault-relative paths instead of absolute paths - **Resource Path Resolution**: Removed extra quotes from Pandoc arguments that could break spawn commands on Windows diff --git a/src/converters/pandoc/PandocCommandBuilder.ts b/src/converters/pandoc/PandocCommandBuilder.ts index f597b34..33685ba 100644 --- a/src/converters/pandoc/PandocCommandBuilder.ts +++ b/src/converters/pandoc/PandocCommandBuilder.ts @@ -46,6 +46,11 @@ export class PandocCommandBuilder { // Enable standalone mode (required for PDF output) args.push('--standalone'); + // Disable citeproc to prevent automatic bibliography processing + // This prevents "document does not contain a bibliography" errors when + // Pandoc detects citation-like patterns but no bibliography file is provided + args.push('--no-citeproc'); + // Embed resources (images, etc.) directly into the output args.push('--embed-resources');