Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: relative references starting with ./ were not replaced on Windows #146

Merged
merged 3 commits into from
Sep 25, 2016

Conversation

wvanderdeijl
Copy link
Contributor

having a reference such as ./subdir/otherfile.txt was not replaced with the hashed filename on Windows.

This issue was caused by determining the relative paths between c:\somedir\somefile.txt and c:\somedir\subdir\otherfile.txt. In the implementation this caused directories c:\somedir/ to be compared to c:\somedir\subdir/ to determine if the second one is a subdir of the first one, which fails because of the usage of both / and
This issues only reproduces on windows because of the \ usage. Relative references like subdir/otherfile.txt were replaced correctly, it's just with the ./ prefix that things went wrong.

for example reference to `./subdir/otherfile.html` from `c:\somedir\somefile.html`
having windows directories with back-slahses (\) confused the logic in get_reference_representations_relative to determine relative paths between two files
due to usage of nodejs Paths.dirname I could not get the windows tests to work on Linux/Mac as the \ character is not used as path separator by Paths
@wvanderdeijl
Copy link
Contributor Author

This seems to be the same issue as #133 and #138 and an alternative fix to PR #139

Unfortunately I had to disable the new test for non-windows platforms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants