mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-27 06:03:51 +03:00
Merge pull request 'feat: highlight Gradle Kotlin as Kotlin' (#6153) from gusted/forgejo-kotlin-gradle into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6153 Reviewed-by: Michael Kriese <michael.kriese@gmx.de> Reviewed-by: Otto <otto@codeberg.org>
This commit is contained in:
commit
8208c9b23b
2 changed files with 8 additions and 1 deletions
|
@ -138,6 +138,7 @@ func CodeFromLexer(lexer chroma.Lexer, code string) template.HTML {
|
|||
// that Chroma expects.
|
||||
var normalizeEnryToChroma = map[string]string{
|
||||
"F#": "FSharp",
|
||||
"Gradle Kotlin DSL": "Kotlin",
|
||||
}
|
||||
|
||||
// File returns a slice of chroma syntax highlighted HTML lines of code and the matched lexer name
|
||||
|
|
|
@ -121,6 +121,12 @@ c=2
|
|||
want: lines(`<span class="k">module</span> <span class="nn">Crypt</span> <span class="o">=</span> <span class="k">let</span> <span class="nv">generateCryptTable</span><span class="o">:</span> <span class="n">array</span><span class="o"><</span><span class="kt">uint32</span><span class="o">></span> <span class="o">=</span>`),
|
||||
lexerName: "FSharp",
|
||||
},
|
||||
{
|
||||
name: "test.gradle.kts",
|
||||
code: "@file:Suppress(\"UnstableApiUsage\")",
|
||||
want: lines("<span class=\"nd\">@file</span><span class=\"p\">:</span><span class=\"n\">Suppress</span><span class=\"p\">(</span><span class=\"s2\">"</span><span class=\"s2\">UnstableApiUsage</span><span class=\"s2\">"</span><span class=\"p\">)</span>"),
|
||||
lexerName: "Kotlin",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
|
|
Loading…
Reference in a new issue