Skip to content

Images missing in editor markdown preview #31294

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

Closed
brechtvl opened this issue Jun 7, 2024 · 0 comments · Fixed by #31299
Closed

Images missing in editor markdown preview #31294

brechtvl opened this issue Jun 7, 2024 · 0 comments · Fixed by #31299
Labels
Milestone

Comments

@brechtvl
Copy link
Contributor

brechtvl commented Jun 7, 2024

Description

When using the editor to edit a markdown file with images, the Preview tab no longer shows images. The images do show correctly when viewing the markdown file without the editor.

Example:
https://demo.gitea.com/brechtvl/test

It appears to be caused by #26745. The link is wrong and /src/ should be replaced by /media/, which used to happen before this change.

RenderMarkup in routers/common/markup.go should probably create a markup.Links with BranchPath and TreePath, but I'm not sure what the best way is to achieve that.

Gitea Version

1.22 (bbe98a3)

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

Ubuntu Linux 23.10

How are you running Gitea?

Running own build from command line.

Database

SQLite

@lunny lunny added this to the 1.22.1 milestone Jun 9, 2024
brechtvl added a commit to brechtvl/gitea that referenced this issue Jun 9, 2024
Parse base path and tree path so that media links can be correctly
created with /media/.

Resolves go-gitea#31294
wxiaoguang pushed a commit to brechtvl/gitea that referenced this issue Jun 16, 2024
Parse base path and tree path so that media links can be correctly
created with /media/.

Resolves go-gitea#31294
wxiaoguang added a commit to wxiaoguang/gitea that referenced this issue Jun 17, 2024
Parse base path and tree path so that media links can be correctly
created with /media/.

Resolves go-gitea#31294

---------

Co-authored-by: wxiaoguang <[email protected]>
# Conflicts:
#	routers/common/markup.go
wxiaoguang added a commit to wxiaoguang/gitea that referenced this issue Jun 17, 2024
Parse base path and tree path so that media links can be correctly
created with /media/.

Resolves go-gitea#31294

---------

Co-authored-by: wxiaoguang <[email protected]>
# Conflicts:
#	routers/common/markup.go
wxiaoguang added a commit that referenced this issue Jun 17, 2024
)

Backport #31299

Parse base path and tree path so that media links can be correctly
created with /media/.

Resolves #31294

---------

Co-authored-by: Brecht Van Lommel <[email protected]>
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Sep 16, 2024
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