Commit Graph
7 Commits
Author SHA1 Message Date
AlexKucera 281c02210a Add Docstrings 2025-11-05 08:03:52 +01:00
AlexKucera 2e1d2673b1 Simplifies path joining logic
Simplifies the path joining logic by leveraging the built-in `path.join` method directly.
This change removes the manual iteration and absolute path handling, resulting in more concise and readable code.

Ensures correct path handling on Windows.
2025-11-04 11:10:53 +01:00
AlexKucera 8329c9dd48 Fixes path handling and adds remote image support
Addresses issues with path construction on Windows by using `path.isAbsolute()` to correctly handle absolute paths.  Improves cross-platform compatibility in temp directory management and binary location.

Adds support for downloading and embedding remote images (http/https URLs) in markdown, enhancing content integration. Provides fallback mechanism with placeholder text upon download failure.
2025-11-04 10:55:24 +01:00
Jarvis ff8e9f9ea3 fix(PathUtils): Improve cross-platform absolute path detection
Replace complex heuristic with precise pattern matching for absolute paths:
- Unix paths: starts with /
- Windows drive letters: C:\ or C:/ using regex /^[a-zA-Z]:[/\\]/
- Windows UNC paths: \\server\share

Removes unreliable temp/tmp path indicators and file: URL checks while
maintaining fs fallback behavior for proper external file processing.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-25 16:44:46 +02:00
Jarvis 4e3ef6ce9c fix(PathUtils): Improve cross-platform absolute path detection without Node.js path module
- Replaced problematic heuristic path.includes('/') && !path.startsWith('.')
- Added explicit checks for Windows drive letters (C:), UNC paths, and Unix absolute paths
- Enhanced detection for temp directories and file URLs across platforms
- Maintains Obsidian API-first approach without importing Node.js path module
- Better handles Windows absolute paths like 'C:\Users\...' and '\UNC\paths'
- Preserves existing fs.access fallback behavior for external files

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-25 16:26:11 +02:00
Jarvis 37015c8ed6 fix: resolve embedded file path resolution issue in PathUtils.fileExists
- Fix pathUtils.fileExists() to handle absolute filesystem paths
- Add proper conversion from absolute to vault-relative paths
- Add fs fallback for external files outside vault
- Resolves 'File not found' errors for embedded PDF, image, and document files
- Maintains compatibility with both vault-relative and absolute paths

This fixes the path resolution issue that occurred after migrating to vault.adapter,
where embedded files were showing as 'not found' because absolute paths were being
passed to vault.adapter.exists() which only accepts vault-relative paths.
2025-09-25 12:43:00 +02:00
Jarvis 5598e0e538 feat: add PathUtils helper class for centralized path operations
- Add ABOUTME comments following guidelines
- Implement safe FileSystemAdapter access with proper type checking
- Use vault.adapter methods (exists, mkdir, list, remove)
- Use normalizePath() consistently for all paths
- Match existing patterns (cleanupDir only removes files, returns boolean)
- Add user-friendly error messages with Notice
- Place in src/core/ alongside other core utilities

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-25 11:44:00 +02:00