Microsoft MakeCode

Docs URLs have double slashes

I am having a bit of trouble with the URLs used for documentation - they emit a double slash, which causes them not to be loaded on my webserver… :confused:

I went into the network panel for pxt-sample and saw that it was doing the same thing

https://microsoft.github.io/pxt-sample/docs//examples/square.md

Repro steps:
Open up http://microsoft.github.io/pxt-sample/
Open up devtools and switch to the network pane
Click on Square example
Result
You will see a network request for
https://microsoft.github.io/pxt-sample/docs//examples/square.md

Expected
No double slashes after the docs
https://microsoft.github.io/pxt-sample/docs/examples/square.md

This accidentally works on github but not when served statically out of a webserver

I have tried all manner of things to fix this including passing --route in pxt staticpkg.

Suggestions?
JFo

I even tried being cheeky and making all my tutorials start with …/docs/examples to generate https://microsoft.github.io/pxt-sample/docs/../docs/examples/square.md

But this broke the internal markdown loading system.

Sorry I missed this post! I noticed this issue while tracking down another bug, and included a fix for it in a PR I just put up: https://github.com/microsoft/pxt/pull/7422/files#diff-1675c23ac4959ff313bfb49cbd2c224cR152 - only found this post while searching around to see if anyone had noticed this before.

Sorry for the trouble!

No worries. That’s great news! :slight_smile:

I wound up temporarily writing something in my webserver to handle it for now… :wink:

JFo