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

Relative paths in Markdown <img> tags not working #16336

Closed
2 of 6 tasks
moqmar opened this issue Jul 4, 2021 · 2 comments
Closed
2 of 6 tasks

Relative paths in Markdown <img> tags not working #16336

moqmar opened this issue Jul 4, 2021 · 2 comments

Comments

@moqmar
Copy link
Contributor

moqmar commented Jul 4, 2021

Description

<img src="test.jpg> in Markdown files now refers to the relative path as the browser would see it, while ![](test.jpg) refers to the relative path in the repository - before, both would work as a relative path. This was discovered in https://codeberg.org/Codeberg/Community/issues/478 and is explained there in more detail; also see the example repository (the uppermost two images were rendering before the commit referenced above and now aren't anymore).

Seems like this is a regression to #8830, which was solved by #10515. The problematic PR is #16098

Screenshots

grafik

@moqmar
Copy link
Contributor Author

moqmar commented Jul 4, 2021

Aaah, I think I found the issue! node.Attr[idx].Val is not the same reference as attr.Val. See https://github.com/go-gitea/gitea/pull/16118/files#diff-5f0f1b16433e5c5930006aad7cc4f230bfafbe755452ffdf9c3c995623110fc4R417 respective line 423 in the old code.

moqmar added a commit to moqmar/gitea that referenced this issue Jul 4, 2021
node.Attr[idx].Val is not the same as attr.Val, the latter is an independent object that won't change anything in the document
@6543
Copy link
Member

6543 commented Jul 4, 2021

#16334

@6543 6543 closed this as completed Jul 4, 2021
@go-gitea go-gitea locked and limited conversation to collaborators Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants