mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-29 04:59:28 +02:00
[BUG] Make chroma match case-insenstive
- In the case that [go-enry](https://github.com/go-enry/go-enry/)
returned langauge doesn't match a lexer name (Either because its not
available or because it doesn't match Chroma's name), a last effort
attempt is made to use Chroma's matching.
- go-enry already applies `strings.ToLower` onto the filename to avoid
being case-sensitive, add the same code for Chroma's matching. The code
being used doesn't rely on the filename being case senstive for correct
matching.
- Adds unit test.
- Resolves #752
(cherry picked from commit dcc442351d
)
This commit is contained in:
parent
5ffa1ee883
commit
aec4a0dd59
2 changed files with 8 additions and 2 deletions
|
@ -109,6 +109,12 @@ c=2
|
|||
),
|
||||
lexerName: "Python",
|
||||
},
|
||||
{
|
||||
name: "DOS.PAS",
|
||||
code: "",
|
||||
want: lines(""),
|
||||
lexerName: "ObjectPascal",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue