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

Relation Paths in Orgmode don't get the Src Prefix #29668

Closed
ankitrgadiya opened this issue Mar 8, 2024 · 0 comments · Fixed by #29669
Closed

Relation Paths in Orgmode don't get the Src Prefix #29668

ankitrgadiya opened this issue Mar 8, 2024 · 0 comments · Fixed by #29669
Labels
Milestone

Comments

@ankitrgadiya
Copy link
Contributor

ankitrgadiya commented Mar 8, 2024

Description

In the Orgmode file, internal links to some other file in the repository are not rendered with the src link (/src/branch-name/tree-path) causing the links to break.

I was able to reproduce it on Demo instance. This is the link to the repository.
https://try.gitea.io/ankitrgadiya/org-links-bug/src/branch/main

It looks like this is happening because the SrcLink is not appended in the Base path. This is the code for Link Rendering in Markdown.

https://github.com/go-gitea/gitea/blob/main/modules/markup/markdown/goldmark.go#L133-L138

Versus, this is the code for Link Rendering in Orgmode.

https://github.com/go-gitea/gitea/blob/main/modules/markup/orgmode/orgmode.go#L145-L148

Gitea Version

v1.21.7

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

Screenshot from 2024-03-08 18-58-21

Screenshot from 2024-03-08 18-58-26

Git Version

2.40.1

Operating System

Debian GNU/Linux 12

How are you running Gitea?

I'm using the official Docker Image and running Gitea using Docker Compose.

Database

SQLite

ankitrgadiya added a commit to ankitrgadiya/gitea that referenced this issue Mar 8, 2024
The internal links to other files in the repository were not rendering with the
Src Prefix (/src/branch-name/file-path). This commit fixes that by using the
`SrcLink` as base if available.

Resolves go-gitea#29668
@lunny lunny added this to the 1.21.8 milestone Mar 8, 2024
lafriks pushed a commit that referenced this issue Mar 10, 2024
The internal links to other files in the repository were not rendering
with the Src Prefix (/src/branch-name/file-path). This commit fixes that
by using the `SrcLink` as base if available.

Resolves #29668
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Mar 10, 2024
The internal links to other files in the repository were not rendering
with the Src Prefix (/src/branch-name/file-path). This commit fixes that
by using the `SrcLink` as base if available.

Resolves go-gitea#29668
KN4CK3R pushed a commit that referenced this issue Mar 10, 2024
Backport #29669 by @ankitrgadiya

The internal links to other files in the repository were not rendering
with the Src Prefix (/src/branch-name/file-path). This commit fixes that
by using the `SrcLink` as base if available.

Resolves #29668

Co-authored-by: Ankit R Gadiya <git@argp.in>
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Jun 9, 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