forgejo_backup/tests/e2e/fixtures/comment.yml
Gusted 8c8d646099 fix: correct image source for quoted reply (#8565)
- Since v10 replies are generated on the fly to handle quoted reply (forgejo/forgejo#5677), this means that we have to do some work to construct markdown that is equivalent to the HTML of the comment.
- Images are slightly strange in the context of issues and pull requests, as Forgejo will render them in the context of the repository and as such links such as `/attachments` become `/user/repo/attachments`, the quoted reply did not take into account and would use `/user/repo/attachments` as link which means it gets transformed to `/user/repo//user/repo/attachments`.
- Instead of fixing this on the backend (and maybe break some existing links), teach the quoted reply about this context and remove it from the image source before generating the markdown.

Reported-by: mrwusel (via Matrix)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8565
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Beowulf <beowulf@beocode.eu>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-07-19 15:03:10 +02:00

22 lines
1.2 KiB
YAML

-
id: 1001
type: 0 # comment
poster_id: 2
issue_id: 1 # in repo_id 1
content: "## Lorem Ipsum\nI would like to say that **I am not appealed** that it took _so long_ for this `feature` to be [created](https://example.com) $e^{\\pi i} + 1 = 0$\n$$e^{\\pi i} + 1 = 0$$\n#1\n```js\nconsole.log('evil')\nalert('evil')\n```\n:+1: :100:\n![hi there](/attachments/3f4f4016-877b-46b3-b79f-ad24519a9cf2)\n\n<img src='/user2/repo1/attachments/3f4f4016-877b-46b3-b79f-ad24519a9cf2' alt='something something' width='500' height='500' />"
created_unix: 946684811
updated_unix: 946684811
content_version: 1
-
id: 1002
type: 21 # code comment
poster_id: 2
issue_id: 19
content: "## Lorem Ipsum\nI would like to say that **I am not appealed** that it took _so long_ for this `feature` to be [created](https://example.com) $e^{\\pi i} + 1 = 0$\n$$e^{\\pi i} + 1 = 0$$\n#1\n```js\nconsole.log('evil')\nalert('evil')\n```\n:+1: :100:\n![hi there](/attachments/3f4f4016-877b-46b3-b79f-ad24519a9cf2)\n\n<img src='/user2/commitsonpr/attachments/3f4f4016-877b-46b3-b79f-ad24519a9cf2' alt='something something' width='500' height='500' />"
review_id: 1001
line: 1
tree_path: "test1.txt"
created_unix: 946684812
invalidated: false
content_version: 1