Corrects inconsistent indentation in FrontmatterProcessor methods
to improve code readability. Adds debug logging for unexpected
types in frontmatter display formatting to aid troubleshooting.
Improves robustness of font settings handling by clarifying
fallback behavior on load failure in TypographySection.
Relates to obsidian-bot-review
Implements error handling for font settings creation to ensure
fallback to default fonts if loading fails. Reorders font size
settings setup to follow font dropdowns for logical flow.
Enhances robustness and improves user settings experience.
Introduces sanitization of frontmatter to remove citation fields,
enhancing data privacy and integrity. Adjusts logic to store
sanitized frontmatter in metadata and reconstruct content while
preserving frontmatter when required. Ensures title in metadata
reflects noteTitle when provided.
Enhances frontmatter processing and metadata handling.
Updates path normalization to disallow absolute paths, ensuring
exports remain within the vault. Enhances security by rejecting
path traversal attempts.
Aligns with obisidian-bot-review branch requirements.
Eliminates redundant methods for adding fallback fonts
and removes an unnecessary import, simplifying the
TypographySection code structure. This streamlines
the user interface logic by cleaning up unused
dropdown components.
Relates to task on branch obsidian-bot-review.
Disables sentence-case rule for UI elements where proper nouns
are used, ensuring intended capitalization is preserved for
acronyms and font names. Adds comments to justify each override
and re-enables the rule after relevant sections.
Enhances path handling by skipping normalization of absolute paths to preserve leading slashes. This prevents potential validation errors when checking output folder paths.
This change increases accuracy and reliability of the path validation logic.
Enhances export submission logic by adding error handling to
manage failures, logging errors for debugging, and providing
user feedback. Re-enables buttons post-failure for retry or
cancellation. Updates description to clarify output folder path
can be absolute or relative.
Relates to user feedback on error transparency.
Replaces manual conversion of absolute paths to vault-relative paths with a utility method to improve code readability and maintainability across various modules. Removes redundant code and streamlines path handling operations.
This refactoring helps ensure consistent path management and reduces potential errors related to path conversion.
Relates to obsidian-bot-review
Introduces toVaultRelativePath method to centralize path conversions,
reducing code duplication and improving maintainability. Extracts
image download completion logic into handleDownloadComplete for clarity.
Relates to obsidian-bot-review
Simplifies array item formatting by eliminating redundant
string manipulations. Enhances readability and maintains
consistent output for arrays with multiple items.
Relates to obsidian-bot-review
Updates method name from 'checkDependenciesAsync' to
'checkDependenciesOnStartup' to better reflect its purpose of
verifying dependencies during plugin startup.
Enhances code readability and maintainability.
Adds user notifications for export and dependency status
errors to improve feedback when operations fail. Utilizes
Obsidian's Notice to display error messages to users.
Relates to obsidian-bot-review branch improvements.
Changes log level 'info' to 'debug' in error handling
to improve granularity in log outputs. Enhances monitoring
capabilities by categorizing non-essential logs separately.
Enhances debugging output by including content length in log
messages, assisting in monitoring and troubleshooting frontmatter
parsing issues efficiently.
Reduces redundant debug information, focusing on concise logging
to maintain readability and effectiveness in error analysis.
Introduces a validation step to ensure the vault configuration directory is accessible. Throws a descriptive error if the directory is unavailable, improving error handling and initialization clarity for the plugin.
Enhances stability by ensuring TempDirectoryManager functions only when prerequisites are satisfied.
Updates plugin cleanup to utilize async handlers during onunload,
ensuring proper resource management and cleanup of temporary files.
Removes redundant process termination listeners and integrates lifecycle
methods for better maintainability and efficiency.
Improves robustness of plugin cleanup on unload.
Specifies Node.js version 18.20+ in package engines and README
to ensure compatibility and leverage latest features available
from this Node.js version.
Resolves critical bugs where directories and files were being created with
doubled paths (e.g., /vault/vault/path) due to incorrect handling of absolute
vs vault-relative paths when using Obsidian's vault adapter.
## Root Cause
The vault.adapter methods (mkdir, write, readBinary, etc.) expect vault-relative
paths, but many parts of the codebase were passing absolute filesystem paths.
This caused the adapter to prepend the vault path again, resulting in doubled
paths like: /Users/user/vault/Users/user/vault/exports
## Changes
### Core Path Handling
- **TempDirectoryManager**: Switched to Node's fs module for temp directory
operations since external tools (pdf2img, ImageMagick, Pandoc) require
absolute filesystem paths and cannot use vault adapter
- **PathUtils.ensureDir()**: Enhanced error messages to provide context about
missing parent directories and permission issues
### Path Conversion Pattern
Implemented consistent pattern throughout codebase: convert absolute paths to
vault-relative before vault.adapter operations by:
1. Checking if path starts with vault base path
2. Stripping vault base path
3. Removing leading slash/backslash
4. Passing vault-relative path to vault.adapter
### Fixed Locations
- **ImageOptimizer**: Convert paths before vault.adapter operations (3 locations)
- **EmbedProcessor**:
- downloadRemoteImage(): path conversion for writeBinary
- copyImageToVaultTemp(): path conversion for vault.adapter operations
- processImageEmbeds(): WebP conversion temp directory
- **PandocTypstConverter**: Use fs module for temp markdown file operations
- **PathResolver**: Convert output folder paths before ensureDir
- **PdfToImageConverter**: Convert output directory path before ensureDir
- **EmbeddedTemplateManager**: Convert template directory paths (2 locations)
### Additional Improvements
- **PathResolver**: Added validation for empty/missing output folder with
clear error message guiding users to plugin settings
- **ESLint**: Changed sentence-case rule from error to warning to reduce
linter noise during development
## Impact
- Fixes directories being created in wrong locations with doubled paths
- Ensures temp directories are accessible by external CLI tools
- Improves error messages for directory creation failures
- Maintains compatibility with both Obsidian's vault adapter and Node's fs
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Corrects capitalization inconsistencies in UI and documentation,
improving clarity and professionalism. Enhances error handling
in the image download function by properly rejecting promises
on errors, thus increasing reliability and maintainability.
Relates to obsidian-bot-review branch tasks.
Applies linting rules to the codebase and resolves identified issues.
Addresses:
- Renamed headings in settings tabs to improve UI consistency and style.
- Resolved require() style imports
- Added void operator to ensure correct promise handling.
- Replaced deprecated Obsidian API calls.
- Enforces sentence case to enhance UI text consistency.
Adds js-yaml as a dependency to support parsing YAML files.
This will allow the application to process YAML formatted data,
enhancing its data handling capabilities.