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

Wiki pages with special characters in mirrors are broken #8284

Closed
2 tasks done
Tekaoh opened this issue Sep 25, 2019 · 1 comment · Fixed by #8408
Closed
2 tasks done

Wiki pages with special characters in mirrors are broken #8284

Tekaoh opened this issue Sep 25, 2019 · 1 comment · Fixed by #8408
Labels

Comments

@Tekaoh
Copy link
Contributor

Tekaoh commented Sep 25, 2019

Description

Github allows you to use special characters in the titles of wiki pages. If you mirror a Github repository with Gitea, it pulls the wiki as well. However, any wiki pages with special characters in the titles cannot be accessed. They redirect to /wiki/_pages instead.

@Tekaoh
Copy link
Contributor Author

Tekaoh commented Oct 6, 2019

I did some deeper digging and found that when you make a wiki page with special characters in the title from within Gitea (instead of from a mirror), it saves the file with escaped characters in the filename. So my solution at #8374 would break any existing wiki pages with special characters in the title because Gitea would be looking for unescaped characters in the filename.

This presents a more complex issue. As it stands right now, a wiki page with special characters in the name does work, but the filename contains escaped characters (Title-with-comma%2C-ampersand-%26-%5Bbrackets%5D.md). The same wiki page from a mirror is broken because the filename contains unescaped characters (Title-with-comma,-ampersand-&-[brackets].md). If we change Gitea to look for filenames with unescaped characters, the reverse will be true.

One way to fix this would be to have Gitea look for an escaped filename first and if it finds none, look again for an unescaped filename. If it finds one, use that. This would allow Gitea to find filenames that are saved either way. This is the solution presented in #8408

My personal opinion is that Gitea should be saving the filenames with unescaped characters as well. Sometimes these wikis are cloned and edited locally. Unescaped filenames are better for that. If Gitea is changed to look for both escaped and unescaped filenames, it could also optionally be changed to save new wiki pages with unescaped characters instead. Also, it could be changed so that any edits made with the Gitea editor to filenames with escaped characters could result in the file being re-saved with unescaped characters.
^ I'm going to separate that into another issue. #8410

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants