From eb20d7110c29f551e19efc212d67cf15775ebc0e Mon Sep 17 00:00:00 2001 From: Gusted Date: Fri, 21 Jul 2023 21:04:05 +0200 Subject: [PATCH] [GITEA] Fix generated source URL on rendered files - The permalink and 'Reference in New issue' URL of an renderable file (those where you can see the source and a rendered version of it, such as markdown) doesn't contain `?display=source`. This leads the issue that the URL doesn't have any effect, as by default the rendered version is shown and thus not the source. - Add `?display=source` to the permalink URL and to 'Reference in New Issue' if it's renderable file. - Add integration testing. (cherry picked from commit 458f20f862aa33aac080c221d852f176d92eb110) (cherry picked from commit 5e630d7b10f1655d4bf480aa1ca5c3f9d411c03f) Conflicts: models/fixtures/repo_unit.yml https://codeberg.org/forgejo/forgejo/pulls/1178 (cherry picked from commit a10c6eb9c90cb3df468e17615df20533d058c4ad) (cherry picked from commit 0fcfb355af23eac29d60b598605cc3cde2265176) --- models/fixtures/repo_unit.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/models/fixtures/repo_unit.yml b/models/fixtures/repo_unit.yml index c22eb8c2a2..b11b882c84 100644 --- a/models/fixtures/repo_unit.yml +++ b/models/fixtures/repo_unit.yml @@ -608,6 +608,20 @@ type: 1 created_unix: 946684810 +# BEGIN Forgejo [GITEA] Fix generated source URL on rendered files +- + id: 1091 + repo_id: 49 + type: 1 + created_unix: 946684810 + +- + id: 1092 + repo_id: 49 + type: 2 + created_unix: 946684810 +# END Forgejo [GITEA] Fix generated source URL on rendered files + - id: 91 repo_id: 58