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

Fix images in Wiki repo not showing in Gitea Wiki (#4690) #5013

Closed
wants to merge 5 commits into from
Closed

Fix images in Wiki repo not showing in Gitea Wiki (#4690) #5013

wants to merge 5 commits into from

Conversation

mattzzw
Copy link

@mattzzw mattzzw commented Oct 3, 2018

wikiRaw method in routers calls WikiNameToFilename which unconditionally adds ".md" to the path.
As a result, findEntryForFile will fail finding the corresponding git blob.
I added WikiNameToFilenameRaw to the model used in wikiRaw which omits any additions to the filename.

Signed-off-by: Matthias Wientapper m.wientapper@gmx.de

wikiRaw method in routers calls WikiNameToFilename which unconditionally adds ".md" to the path.
As a result, findEntryForFile will fail finding the corresponding git blob.
I added WikiNameToFilenameRaw to the model used in wikiRaw which omits any additions to the filename.
@jonasfranz
Copy link
Member

Please fmt and commit.

@bkcsoft bkcsoft added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 5, 2018
@codecov-io
Copy link

codecov-io commented Oct 5, 2018

Codecov Report

Merging #5013 into master will increase coverage by 0.06%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5013      +/-   ##
==========================================
+ Coverage    37.5%   37.56%   +0.06%     
==========================================
  Files         309      309              
  Lines       45820    45820              
==========================================
+ Hits        17183    17214      +31     
+ Misses      26176    26142      -34     
- Partials     2461     2464       +3
Impacted Files Coverage Δ
routers/repo/wiki.go 44.96% <0%> (ø) ⬆️
models/repo_indexer.go 52.96% <0%> (+0.84%) ⬆️
modules/log/file.go 65.89% <0%> (+22.48%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b845119...6a0202b. Read the comment docs.

@lunny
Copy link
Member

lunny commented Oct 6, 2018

Tests will be better.

models/wiki.go Outdated
name = strings.Replace(name, " ", "-", -1)
return url.QueryEscape(name)
}

// WikiFilenameToName converts a wiki filename to its corresponding page name.
func WikiFilenameToName(filename string) (string, error) {
Copy link
Member

Choose a reason for hiding this comment

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

WikiNameToFilename should reuse WikiNameToFilenameRaw

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the review.
Now that I look at the code of models/wiki.go again I can't see the difference between WikiNameToFilenameRawand WikiNameToSubURL. I think I totally duplicated a method that was already in place... Doh.
I will fix that.

@bkcsoft bkcsoft added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Oct 8, 2018
@mattzzw
Copy link
Author

mattzzw commented Dec 15, 2018

Gentle bump. 😃
Can I do anything to make this simple PR acceptable?

@lunny
Copy link
Member

lunny commented Dec 16, 2018

@mattzzw as I mentioned before could you add some tests that will let review easier.

@zeripath
Copy link
Contributor

I think this has been fixed by #5814

@lunny lunny closed this Feb 13, 2019
@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
lgtm/need 1 This PR needs approval from one additional maintainer to be merged. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants