URLs in nav items in subrepos are incorrectly rewritten#123
Open
ramonbroox wants to merge 1 commit intojdoiro3:mainfrom
Open
URLs in nav items in subrepos are incorrectly rewritten#123ramonbroox wants to merge 1 commit intojdoiro3:mainfrom
ramonbroox wants to merge 1 commit intojdoiro3:mainfrom
Conversation
Version Number CheckUpdate the version in pyproject.toml if you want this PR to generate a new release (main is 0.6.3 >= 0.6.3). In addition, please update the CHANGELOG.md. |
Spacetown
reviewed
Nov 24, 2023
| for index, entry in enumerate(nav): | ||
| if isinstance(entry, str): | ||
| nav[index] = str(section_name / Path(entry)).replace("\\", "/") | ||
| if entry.startswith("http"): |
Contributor
There was a problem hiding this comment.
And ftp or other schemas? What about using urlparse?
Owner
There was a problem hiding this comment.
also, you can make this one line.
nav[index] = str(section_name / Path(entry)).replace("\\", "/") if not urlparse.some_method(entry) else entry| if type(value) is list: | ||
| resolve_nav_paths(value, section_name) | ||
| else: | ||
| elif type(value) is str and value.startswith("http"): |
jdoiro3
requested changes
Dec 1, 2023
Owner
jdoiro3
left a comment
There was a problem hiding this comment.
Thanks for contributing. You can also ignore the PR comment. I'm going to merge this once you use urlparse as @Spacetown suggested.
| for index, entry in enumerate(nav): | ||
| if isinstance(entry, str): | ||
| nav[index] = str(section_name / Path(entry)).replace("\\", "/") | ||
| if entry.startswith("http"): |
Owner
There was a problem hiding this comment.
also, you can make this one line.
nav[index] = str(section_name / Path(entry)).replace("\\", "/") if not urlparse.some_method(entry) else entry|
Hey, I ran into this issue as well. What would be needed to get this fixed. I am happy to provide a PR, with the changes above. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If a subrepo has a URL in a nav item:
support.py:resolve_nav_paths()rewrites the link making it unusable.