obsidian-scholar icon indicating copy to clipboard operation
obsidian-scholar copied to clipboard

Windows default path separator breaks PDF link

Open Accelsnow opened this issue 8 months ago • 0 comments

When using the plugin on Windows platform, the plugin is able to parse the URL and download the PDF as-intended. However, when it creates the paper note, the link to the downloaded local PDF file in the 'pdf' property is invalid because it uses '' as separator instead of '/'. Screenshot:

image

image

I understand that on Windows, if I am using absolute path, the separator should be '' (e.g. C:\Users\user\obsidian). However, it seems like the auto generated link uses relative path, which uses '/' as path separator.

I am able to fix this problem myself by changing the main.js file of the plugin and make function getSystemPathSeparator() always return '/'. I am wondering if the platform-dependent separator is indeed intended or is it potentially a bug (Windows + relative path).


Steps to reproduce:

  1. add any paper through Scholar: Add paper to library
  2. PDF will be downloaded and note will be created. But note contains invalid local PDF link, leading to invalid file property.

Platform: Windows Plugin version: 1.3.3 Obsidian version: 1.6.3

Accelsnow avatar Jun 17 '24 16:06 Accelsnow