mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-28 05:15:53 +00:00
fix: recognize linguist language aliases (#39135)
Co-authored-by: loveulvu <ax9inl@google.com>
This commit is contained in:
@@ -114,6 +114,10 @@ func GetLanguageStats(ctx context.Context, repo *git.Repository, commitID string
|
||||
if hasLanguage := attrs.GetLanguage(); hasLanguage.Value() != "" {
|
||||
language := hasLanguage.Value()
|
||||
|
||||
if canonicalLanguage, ok := enry.GetLanguageByAlias(language); ok {
|
||||
language = canonicalLanguage
|
||||
}
|
||||
|
||||
// group languages, such as Pug -> HTML; SCSS -> CSS
|
||||
group := enry.GetLanguageGroup(language)
|
||||
if len(group) != 0 {
|
||||
|
||||
Reference in New Issue
Block a user