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

Check for /index on pages' slug #6789

Merged
merged 5 commits into from
Mar 18, 2020
Merged

Check for /index on pages' slug #6789

merged 5 commits into from
Mar 18, 2020

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Mar 17, 2020

Closes #4638 (last use of project.documentation_type here)
Fixes #5254

@stsewd stsewd requested a review from a team March 17, 2020 20:18
Copy link
Member

@humitos humitos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me!

if main_project.documentation_type == 'sphinx_htmldir':
path = page_slug + '/'
if version.documentation_type == 'sphinx_htmldir':
path = re.sub('/index$', '', page_slug) + '/'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we use the regex module that has timeout here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

regex are dangerous when the user provides the pattern, this pattern is simple enough.

@stsewd stsewd merged commit 2b47c40 into master Mar 18, 2020
@stsewd stsewd deleted the fix-index-file-htmldir branch March 18, 2020 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broken links in version picker menu for HtmlDir index pages Deprecate Project.documentation_type
2 participants