-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 incorrect replacement in markdown image links #26562
Fix incorrect replacement in markdown image links #26562
Conversation
Please also check: if we are not inserting the image link into DB. <--- Less probable situation. |
ok , but I'm puzzled about this unit test case that didn't pass |
Your unit test cases are failing, you changed the path of image so you need to change in the unit test cases. https://github.com/go-gitea/gitea/actions/runs/5887628224/job/15967326590?pr=26562#step:8:112 |
I am confused about this test case. For both test cases, the rendering before and after my changes in the page display is consistent:
|
Can you push your code. I can take a look. |
At first, I also considered to add Lines 1312 to 1319 in c6b92c8
Is it ok that just support So maybe we need to combine the url instead of replace |
That's not my concern, I do think there's something wrong with this test case. For the current gitea it is actually the rendered result below.
|
The path that is forming in the test case is wrong. Still |
What I mean is that there is something wrong with this test case, the expected results are not the same as what I see on the gitea page. @puni9869 @yp05327 |
It seems that in old version the media link is |
I see why this fix is not good. for example: |
I'm not saying that my current solution is right, I think we need to address this outdated test case first and then consider a good solution. |
There are other places which replace |
Maybe split string on |
No good solution for now, this bug only affects users or repositories with the name |
No worries, You have tried , Appreciated for the great efforts. |
I will post another solution. |
Added a fix with #26745 |
Fix #26548
When the repo name is
src
:/<user>/src/src/branch/
=>/<user>/media/src/branch/
it should be:
/<user>/src/src/branch/
=>/<user>/src/media/branch/