forgejo/modules/markup
TurtleArmy 2b42fdaa26 feat(ui): Fix comma separated attributes in code blocks language preventing syntax-highlighting (#12056)
Currently, forgejo does not support syntax highlighting code-blocks that have comma separated attributes after the language. This is a pattern sometimes seen in Rust code blocks, with tests like this:

\`\`\`rust
#[test]
fn run_this_test() { /* ... */ }
\`\`\`

\`\`\`rust,ignore
#[test]
fn skip_this_test() { /* ... */ }
\`\`\`

Currently, forgejo only does syntax highlighting in the first case:

```rust
#[test]
fn run_this_test() { /* ... */ }
```

```rust,ignore
#[test]
fn skip_this_test() { /* ... */ }
```

An example of this causing problems can be seen in this commit (5be9c5b7d2) causing the following issue (https://codeberg.org/zesterer/ariadne/issues/188).

This PR fixes fixes the second case not getting proper syntax highlighting.

Co-authored-by: TurtleArmy <44322335+TurtleArmyMc@users.noreply.github.com>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/12056
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Ellen Εμίλια Άννα Zscheile <fogti@noreply.codeberg.org>
Co-authored-by: TurtleArmy <turtlearmy@noreply.codeberg.org>
Co-committed-by: TurtleArmy <turtlearmy@noreply.codeberg.org>
2026-04-12 18:30:30 +02:00
..
asciicast chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
common fix various typos (#7690) 2025-04-28 06:46:29 +00:00
console Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
csv Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
external chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
markdown feat(ui): Fix comma separated attributes in code blocks language preventing syntax-highlighting (#12056) 2026-04-12 18:30:30 +02:00
mdstripper Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
orgmode Update module github.com/alecthomas/chroma/v2 to v2.21.1 (forgejo) (#10479) 2025-12-20 17:13:12 +01:00
tests/repo/repo1_filepreview fix inline file preview for files with encoded URL, fix #5069 (#6525) 2025-01-30 08:20:05 +00:00
camo.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
camo_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
file_preview.go chore: add modernizer linter (#11936) 2026-04-02 03:29:37 +02:00
html.go chore: add modernizer linter (#11936) 2026-04-02 03:29:37 +02:00
html_internal_test.go fix: escape HTML tags in inline code blocks in description (#10897) 2026-01-25 23:10:56 +01:00
html_test.go fix: escape HTML tags in inline code blocks in description (#10897) 2026-01-25 23:10:56 +01:00
renderer.go chore: add modernizer linter (#11936) 2026-04-02 03:29:37 +02:00
renderer_test.go fix: markup rendering panic must not abort the process (#9478) 2025-09-30 09:39:34 +02:00
sanitizer.go Add to html button in markdown type="button" (#10520) 2025-12-21 05:21:27 +01:00
sanitizer_test.go fix(ui): add missing lazy load attribute to images (#8246) 2025-06-25 18:31:03 +02:00