0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-02-22 13:57:46 -05:00
forgejo/modules/markup
Robert Wolff 95f231612b fix: inline file preview for rendered files (#6572)
This fixes the inline file preview for rendered files (e.g., markdown). [Here, a live issue in v11](https://v11.next.forgejo.org/mahlzahn/test-inline-file-preview/issues/1) and [the same in v7 (with even more bugs)](https://v7.next.forgejo.org/mahlzahn/test-inline-file-preview/issues/1).

It fixes
1. the inline preview for possibly rendered files, when the link is specified with `?display=source`. This happens, e.g., if you are watching a (e.g., markdown) file in source and then want to link some of its lines.
2. the link to the source file inside the inline preview for possible rendered files (currently it links to the rendered version and then the `#L…` cannot point to the correct lines). This is done by always adding `?display=source` to the link.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6572
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Robert Wolff <mahlzahn@posteo.de>
Co-committed-by: Robert Wolff <mahlzahn@posteo.de>
2025-01-25 08:11:37 +00:00
..
asciicast Fix and refactor markdown rendering (#32522) 2024-11-17 20:34:28 +01:00
common
console Construct screen 2024-09-06 20:24:51 +02:00
csv Fix and refactor markdown rendering (#32522) 2024-11-17 20:34:28 +01:00
external
markdown fix: remove softbreak from github legacy callout 2024-12-04 22:08:38 +01:00
mdstripper chore: fix deprecation 2024-11-02 16:39:27 +01:00
orgmode Update module github.com/alecthomas/chroma/v2 to v2.15.0 (forgejo) (#6477) 2025-01-06 04:11:25 +00:00
tests/repo/repo1_filepreview fix: inline file preview for rendered files (#6572) 2025-01-25 08:11:37 +00:00
camo.go Use camo.Always instead of camo.Allways (#32097) 2024-09-27 08:45:55 +02:00
camo_test.go Use camo.Always instead of camo.Allways (#32097) 2024-09-27 08:45:55 +02:00
file_preview.go fix: inline file preview for rendered files (#6572) 2025-01-25 08:11:37 +00:00
html.go feat: Add partial quoting 2024-10-26 19:15:43 +02:00
html_internal_test.go fix: improve PR/issue short link display text 2024-08-22 15:49:05 -06:00
html_test.go fix: inline file preview for rendered files (#6572) 2025-01-25 08:11:37 +00:00
renderer.go [CHORE] Remove github.com/yuin/goldmark-meta 2024-07-07 03:18:13 +02:00
renderer_test.go
sanitizer.go fix: strict matching of allowed content for sanitizer 2024-11-15 10:59:36 +01:00
sanitizer_test.go feat: Add partial quoting 2024-10-26 19:15:43 +02:00