Ensures accurate determination of whether a directory is a temporary directory by explicitly matching the full path or a subdirectory.
This change prevents potential issues related to incorrect path comparisons, especially on Windows where path variations can occur.
Updates the executable path resolution logic to correctly identify executables on Windows systems by using the 'where' command instead of 'which', which is not available on Windows.
This change ensures that the application can locate and execute dependencies properly, regardless of the operating system. It also uses `path.isAbsolute` to accurately determine if a user-provided path is absolute, improving the reliability of path resolution.
Addresses a potential command injection vulnerability by tightening the validation of executable paths.
Removes brackets and curly braces from the list of disallowed shell metacharacters in paths on Windows to prevent issues when paths contain these characters. Only the metacharacters that can't appear in safe paths are disallowed.
Ensures correct protocol (HTTP/HTTPS) is used when downloading
remote images by using the parsed URL object for the request.
This fixes potential issues where the protocol might be incorrectly
determined, especially when dealing with case-insensitive URL schemes.
Enhances path validation to prevent issues caused by reserved Windows names.
The previous implementation only checked for reserved names
when the entire path matched a reserved name. This update extends
the check to ensure that no segment of the path, including the
base name without extension, matches a reserved name.
This prevents the use of reserved names, even with extensions or
within directory structures, mitigating potential security risks.
Ensures that the PATH environment variable is correctly augmented with
additional paths, especially on Windows systems. It uses platform-specific
path delimiters (';' on Windows, ':' on Unix) and filters out empty segments
to prevent PATH corruption.
Addresses potential resource leaks by ensuring that temporary
files and event listeners are properly cleaned up when the
converter is disposed. This prevents issues with multiple
conversions, especially on platforms like Windows where file
locking can occur.
The `uncaughtException` handler is removed to avoid
swallowing errors, and a flag is added to prevent double
cleanup.
Ensures that relative redirect URLs are resolved against the original image URL.
This prevents issues when downloading remote images from servers that return
relative redirect paths.
Ensures images without file extensions are properly handled by appending ".png" to the filename, preventing potential issues with image processing or display.
Preserves existing extensions for other image types (e.g., svg, ico, avif) without forcing a ".png" extension.
Adds comprehensive unit tests to improve code coverage for core functionalities: constants, paper size mapping, modal settings, security utilities, temporary directory management, and variable mapping.
This ensures that basic functionalities work as expected and enhances the reliability of the plugin.
Additionally, this commit includes a mock Obsidian API to facilitate testing in a non-Obsidian environment.
Removes unnecessary conditional logic when constructing paths for temporary directories.
The logic previously checked if the plugin directory was absolute before joining it with the directory name. This check is redundant as `path.join` correctly handles both absolute and relative paths.
Ensures that standard markdown images with remote URLs are processed for download after embeds and before wikilinks.
This ensures that remote URLs in the standard markdown format `` are correctly queued for download.
Consolidates local path resolution logic into a dedicated
`resolveLocalPath` method for improved code reuse and readability.
Improves image downloading by using the vault adapter to write
binary data, preventing potential data corruption.
This change addresses issues with image embed resolution,
especially for attachments in non-standard locations, and fixes
file overwriting during image downloads.
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.
Refactors the code to leverage `path.join` for cross-platform path manipulation, especially improving handling of absolute paths on Windows.
Removes redundant normalizations and simplifies the logic for determining temporary directories. This change ensures consistent behavior across different operating systems and reduces code complexity.
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.
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.