jgm / pandoc

Universal markup converter
https://pandoc.org
Other
34.69k stars 3.39k forks source link

Windows test failure #2589

Closed jgm closed 8 years ago

jgm commented 8 years ago

screen shot 2015-12-13 at 5 11 51 pm

jgm commented 8 years ago

Line 536 of the ICML writer uses pathSeparator - could it just as well use /? Then the test output would not vary with OS. The pathSeparator was added in 9deb335c. I think it can be removed safely, or we can use Posix.pathSeparator as we do in Shared.

jgm commented 8 years ago

@mb21 this was your code, according to the commit message. Any ideas? According to this, one should never get something like file://./lalune.jpg, let alone file://.\lalune.jpg. Do we need the file://? If so, should we get the absolute path to the file and insert that? Finally, can we use posix separators (/)?

jgm commented 8 years ago

Interestingly, in the ICML spec they have examples like "file:D:/images/pumpkin.jpg" without the //. Looks like forward slashes are fine.

mb21 commented 8 years ago

It was "file:" ++ src before 9deb335ca5fbf9f1db0cd1d046d2b59a9a5a55fe, where I changed it to "file://." ++ pathSeparator : src and if I remember correctly, the reason was that relative paths didn't work before. This is not well documented, but seems to be the only way in IDML, even if it's not RFC 3986 conform.

btw, you can get a free trial of InDesign or InCopy...

mb21 commented 8 years ago

But maybe we should use file: for absolute paths and "file://./" ++ src for relative ones (it's possible that this would work for Windows as well, I don't have a Windows install handy..)

mb21 commented 8 years ago

Actually I just tried "file:foo.jpg" and "file:/Users/myuser/foo.jpg" on InCopy CS6 and InDesign CC 2015 on Mac OS X and both worked. So not quite sure what's changed, but you can disregard what I said before...

jgm commented 8 years ago

OK, thanks - so what I have now in head is okay, then?

+++ Mauro Bieg [Dec 14 15 07:01 ]:

Actually I just tried "file:foo.jpg" and "file:/Users/myuser/foo.jpg" on InCopy CS6 and InDesign CC 2015 on Mac OS X and both worked. So not quite sure what's changed, but you can disregard what I said before...

— Reply to this email directly or [1]view it on GitHub.

References

  1. https://github.com/jgm/pandoc/issues/2589#issuecomment-164459081
mb21 commented 8 years ago

yes, at least on a Mac it works, but from the example you posted ("file:D:/images/pumpkin.jpg"), I'm fairly confident it works on Windows as well.

jgm commented 8 years ago

Great.

+++ Mauro Bieg [Dec 14 15 08:34 ]:

yes, at least on a Mac it works, but from the example you posted ("file:D:/images/pumpkin.jpg"), I'm fairly confident it works on Windows as well.

— Reply to this email directly or [1]view it on GitHub.

References

  1. https://github.com/jgm/pandoc/issues/2589#issuecomment-164487192