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

Cannot navigate to sub-path #539

Open
zampino opened this issue Jul 31, 2023 · 0 comments
Open

Cannot navigate to sub-path #539

zampino opened this issue Jul 31, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@zampino
Copy link
Collaborator

zampino commented Jul 31, 2023

Assume we're showing a notebook at URL path /notebooks/my-ns and this has a link to /notebooks/my-ns/sub. Following the link redirects to the index.

This is because we intercept the anchor click and navigate to /sub which doesn't exist. This is due to

(defn ->doc-url [url]
(let [path (js/decodeURI (.-pathname url))
doc-path (js/decodeURI (.-pathname (.-location js/document)))]
(if (str/starts-with? path doc-path)
(subs path (count doc-path))
(subs path 1))))

I can't see why we need to produce relative paths in the click handler.

@zampino zampino changed the title Cannot navigate to sub namespace Cannot navigate to sub-namespace Jul 31, 2023
@zampino zampino added the bug Something isn't working label Jul 31, 2023
@zampino zampino changed the title Cannot navigate to sub-namespace Cannot navigate to sub-path Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant