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
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
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
camo_test.go
file_preview.go fix: inline file preview for rendered files (#6572) 2025-01-25 08:11:37 +00:00
html.go
html_internal_test.go
html_test.go fix: inline file preview for rendered files (#6572) 2025-01-25 08:11:37 +00:00
renderer.go
renderer_test.go
sanitizer.go fix: strict matching of allowed content for sanitizer 2024-11-15 10:59:36 +01:00
sanitizer_test.go