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

Mirror project: wrong path to images #15075

Closed
1 of 4 tasks
somera opened this issue Mar 20, 2021 · 10 comments · Fixed by #15088
Closed
1 of 4 tasks

Mirror project: wrong path to images #15075

somera opened this issue Mar 20, 2021 · 10 comments · Fixed by #15088
Labels

Comments

@somera
Copy link

somera commented Mar 20, 2021

  • Gitea version (or commit ref): 1.13.4
  • Git version:
  • Operating system:
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite

Description

When I migrate https://github.com/cassiomolin/log-aggregation-spring-boot-elastic-stack then I get in browser

image

The problem is the brocken url path to the image:

image

@zeripath
Copy link
Contributor

You need to tell us what the file actually links to in the markdown, what it was rendered to, what you expected, what your appurl URL and give us some indication as to how you expect us to be able to guess that this is what it should be.

We could potentially change the base URL for the render but I think we may be screwed at making this work.

@somera
Copy link
Author

somera commented Mar 21, 2021

Sorry. My gitea config

[server]
SSH_DOMAIN       = nuc-mini-celeron
DOMAIN           = nuc-mini-celeron
HTTP_PORT        = 3000
ROOT_URL         = http://nuc-mini-celeron:3000/

The URL to the image on the GitHub page looks is

https://github.com/cassiomolin/log-aggregation-spring-boot-elastic-stack/blob/master/misc/img/diagrams/elastic-stack.png

The link in my local Gitea instance is

http://nuc-mini-celeron:3000/misc/img/diagrams/elastic-stack.png

Misc is on in my Gitea an organization.

It's not bad, that the image isn't shown. But the basic authentication "sucks".

@lunny lunny added the type/bug label Mar 21, 2021
@lunny
Copy link
Member

lunny commented Mar 21, 2021

markdown rendering related. /misc/img/diagrams/elastic-stack.png should be rendered as /cassiomolin/log-aggregation-spring-boot-elastic-stack/blob/master/misc/img/diagrams/elastic-stack.png.

@silverwind
Copy link
Member

Auth popup is a separate issue where the browser hits the HTTPS endpoint meant for the git client which should never happen. If there are steps to reproduce this popup, please open a separate issue with them.

@zeripath
Copy link
Contributor

zeripath commented Mar 21, 2021

OK so the actual markdown that is being misrendered is:

![Elastic Stack][img.elastic-stack]

which is then linked to a reference at the bottom of the file:

  [img.elastic-stack]: /misc/img/diagrams/elastic-stack.png

@zeripath
Copy link
Contributor

So it's the linked reference paths aren't being handled properly

@zeripath
Copy link
Contributor

zeripath commented Mar 21, 2021

OK it's actually not that - it's with or without preceding slash that makes the difference.

Screenshot from 2021-03-21 15-35-47

zeripath added a commit to zeripath/gitea that referenced this issue Mar 21, 2021
Fix go-gitea#15075

Signed-off-by: Andrew Thornton <art27@cantab.net>
lunny pushed a commit that referenced this issue Apr 10, 2021
…#15088)

* Links in markdown should be absolute to the repository not the server

Fix #15075

Signed-off-by: Andrew Thornton <art27@cantab.net>

* match github

Signed-off-by: Andrew Thornton <art27@cantab.net>

* add testcase

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: 6543 <6543@obermui.de>
@somera
Copy link
Author

somera commented Apr 11, 2021

Should this work in 1.14.0?

@6543
Copy link
Member

6543 commented Apr 11, 2021

1.15.0

@somera
Copy link
Author

somera commented Apr 11, 2021

1.15.0

Thx. Cause I saw

image

But 1.15.0 is good!

@go-gitea go-gitea locked and limited conversation to collaborators May 13, 2021
AbdulrhmnGhanem pushed a commit to kitspace/gitea that referenced this issue Aug 10, 2021
…go-gitea#15088)

* Links in markdown should be absolute to the repository not the server

Fix go-gitea#15075

Signed-off-by: Andrew Thornton <art27@cantab.net>

* match github

Signed-off-by: Andrew Thornton <art27@cantab.net>

* add testcase

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: 6543 <6543@obermui.de>
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.

5 participants