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

Always use forward slash for file paths when generating the website #628

Closed
yamgent opened this issue Jan 23, 2019 · 2 comments · Fixed by #643
Closed

Always use forward slash for file paths when generating the website #628

yamgent opened this issue Jan 23, 2019 · 2 comments · Fixed by #643

Comments

@yamgent
Copy link
Member

yamgent commented Jan 23, 2019

Tell us about your environment

  • MarkBind Version: 1.17.0

What did you do? Please include the actual source code causing the issue.

Repeat the steps on 2 different platforms (Windows vs Mac/Linux):

  1. markbind init
  2. markbind build
  3. Check the file paths inside the generated index.html.

What did you expect to happen?

The file paths generated should use a consistent slash (i.e. /), regardless of the OS that the author is running.

What actually happened? Please include the actual, raw output.

  • On Windows, the slash generated is \.
<script src="markbind\js\setup.js"></script>
<script src="markbind\layouts\default\scripts.js"></script>
</html>
  • On Mac & Linux, the slash generated is /.
<script src="markbind/js/setup.js"></script>
<script src="markbind/layouts/default/scripts.js"></script>
</html>
@nicholaschuayunzhi
Copy link
Contributor

I don't think there's an option in path library that enforces consistent path separator. Perhaps we may have to write a wrapper over the functions we use to replace \ with /?

This will also make the file compare process easier/less prone to bugs.

@Xenonym
Copy link
Contributor

Xenonym commented Jan 25, 2019

A similar problem was encountered with the implementation of #475 serve --one-page, which was solved by adding the function ensurePosixPath (d86153c) to replace \ with /. We could use that to resolve this as well.

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

Successfully merging a pull request may close this issue.

3 participants