mirror of
https://github.com/cheat/cheat.git
synced 2026-05-07 18:13:50 +02:00
chore(deps): bump github.com/alecthomas/chroma/v2 from 2.23.1 to 2.24.1
Bumps [github.com/alecthomas/chroma/v2](https://github.com/alecthomas/chroma) from 2.23.1 to 2.24.1. - [Release notes](https://github.com/alecthomas/chroma/releases) - [Commits](https://github.com/alecthomas/chroma/compare/v2.23.1...v2.24.1) --- updated-dependencies: - dependency-name: github.com/alecthomas/chroma/v2 dependency-version: 2.24.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
29
vendor/github.com/alecthomas/chroma/v2/lexers/erb.go
generated
vendored
Normal file
29
vendor/github.com/alecthomas/chroma/v2/lexers/erb.go
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
package lexers
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
. "github.com/alecthomas/chroma/v2" // nolint
|
||||
)
|
||||
|
||||
// ERB lexer is Ruby embedded in HTML.
|
||||
var ERB = Register(DelegatingLexer(HTML, MustNewXMLLexer(
|
||||
embedded,
|
||||
"embedded/erb.xml",
|
||||
).SetConfig(
|
||||
&Config{
|
||||
Name: "ERB",
|
||||
Aliases: []string{"erb", "html+erb", "html+ruby", "rhtml"},
|
||||
Filenames: []string{"*.erb", "*.html.erb", "*.xml.erb", "*.rhtml"},
|
||||
MimeTypes: []string{"application/x-ruby-templating"},
|
||||
DotAll: true,
|
||||
},
|
||||
).SetAnalyser(func(text string) float32 {
|
||||
if strings.Contains(text, "<%=") && strings.Contains(text, "%>") {
|
||||
return 0.4
|
||||
}
|
||||
if strings.Contains(text, "<%") {
|
||||
return 0.1
|
||||
}
|
||||
return 0.0
|
||||
})))
|
||||
Reference in New Issue
Block a user