jojo/modules/markup/markdown
TurtleArmy 5b6c702f41 feat(ui): support Pandoc style code blocks (#12099)
This resolves https://codeberg.org/forgejo/forgejo/issues/11107.

Codeberg doesn't support [Pandoc style code blocks](https://pandoc.org/MANUAL.html#extension-fenced_code_attributes), so only the two of these 3 will have syntax highlighting.

\`\`\`haskell
qsort []     = []
qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++
               qsort (filter (>= x) xs)
\`\`\`

\`\`\`haskell {.numberLines}
qsort []     = []
qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++
               qsort (filter (>= x) xs)
\`\`\`

\`\`\`{.numberLines .haskell}
qsort []     = []
qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++
               qsort (filter (>= x) xs)
\`\`\`

```haskell
qsort []     = []
qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++
               qsort (filter (>= x) xs)
```

```haskell {.numberLines}
qsort []     = []
qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++
               qsort (filter (>= x) xs)
```

```{.numberLines .haskell}
qsort []     = []
qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++
               qsort (filter (>= x) xs)
```

This PR adds syntax highlighting to the examples with Pandoc style code blocks. It also adds redundant code to explicitly handle the second case with the trailing attribute syntax, which might be unnecessary since it already works, but I think should be fine to leave in.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/12099
Reviewed-by: Ellen Εμίλια Άννα Zscheile <fogti@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2026-05-12 00:53:09 +02:00
..
callout chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
math chore: add modernizer linter (#11936) 2026-04-02 03:29:37 +02:00
util fix: enable multi-line math equations in wiki (#8424) 2025-07-06 22:00:09 +02:00
ast.go chore: Remove IsXXX 2025-01-31 16:22:29 +01:00
color_util.go feat: support color dots for 4 character hex. 2024-11-02 13:37:14 +01:00
color_util_test.go feat: support color dots for 4 character hex. 2024-11-02 13:37:14 +01:00
convertyaml.go chore: replace gopkg.in/yaml.v3 with go.yaml.in/yaml/v3 (#8956) 2025-08-20 15:31:12 +02:00
goldmark.go feat(ui): Fix comma separated attributes in code blocks language preventing syntax-highlighting (#12056) 2026-04-12 18:30:30 +02:00
markdown.go chore: add modernizer linter (#11936) 2026-04-02 03:29:37 +02:00
markdown_test.go feat(ui): support Pandoc style code blocks (#12099) 2026-05-12 00:53:09 +02:00
meta.go chore: replace gopkg.in/yaml.v3 with go.yaml.in/yaml/v3 (#8956) 2025-08-20 15:31:12 +02:00
meta_test.go chore: add modernizer linter (#11936) 2026-04-02 03:29:37 +02:00
prefixed_id.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
renderconfig.go chore: replace gopkg.in/yaml.v3 with go.yaml.in/yaml/v3 (#8956) 2025-08-20 15:31:12 +02:00
renderconfig_test.go chore: replace gopkg.in/yaml.v3 with go.yaml.in/yaml/v3 (#8956) 2025-08-20 15:31:12 +02:00
toc.go chore: add modernizer linter (#11936) 2026-04-02 03:29:37 +02:00
transform_codeblock_lang.go feat(ui): support Pandoc style code blocks (#12099) 2026-05-12 00:53:09 +02:00
transform_codespan.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
transform_heading.go chore: add modernizer linter (#11936) 2026-04-02 03:29:37 +02:00
transform_html.go Add to html button in markdown type="button" (#10520) 2025-12-21 05:21:27 +01:00
transform_image.go fix(ui): add missing lazy load attribute to images (#8246) 2025-06-25 18:31:03 +02:00
transform_link.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
transform_list.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00