fix: Process embeds before wikilinks to prevent incorrect .md extensions on images

- Reorder processing steps: embeds first, then wikilinks
- Prevents ![[image.jpg]] from becoming ![](image.jpg.md)
- Ensures image filenames remain correct for Pandoc/Typst resolution

This fixes the core issue where image files were getting .md extensions
appended, causing Typst to look for non-existent .md files instead of
the actual image files.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Jarvis committed 2025-08-30 17:57:31 +02:00
1 parent c9bd4cb210
commit d765f09402
2 files changed
+48 -8

No files matched your search

+4 -4
View File
@@ -97,12 +97,12 @@ export class MarkdownPreprocessor {
}
}
// Step 3: Convert wikilinks
result.content = this.parseWikilinks(result.content, result);
// Step 4: Convert embeds
// Step 3: Convert embeds FIRST (before wikilinks to avoid .md extension being added)
result.content = this.parseEmbeds(result.content, result);
// Step 4: Convert wikilinks (after embeds are processed)
result.content = this.parseWikilinks(result.content, result);
// Step 5: Convert callouts
result.content = this.parseCallouts(result.content, result);