mirror of
https://github.com/go-gitea/gitea
synced 2024-11-09 11:31:34 +01:00
25677cdc5b
Update chroma to 0.9.4 Signed-off-by: Andrew Thornton <art27@cantab.net>
27 lines
591 B
Go
Vendored
27 lines
591 B
Go
Vendored
package b
|
|
|
|
import (
|
|
. "github.com/alecthomas/chroma" // nolint
|
|
"github.com/alecthomas/chroma/lexers/internal"
|
|
)
|
|
|
|
// BashSession lexer.
|
|
var BashSession = internal.Register(MustNewLazyLexer(
|
|
&Config{
|
|
Name: "BashSession",
|
|
Aliases: []string{"bash-session", "console", "shell-session"},
|
|
Filenames: []string{".sh-session"},
|
|
MimeTypes: []string{"text/x-sh"},
|
|
EnsureNL: true,
|
|
},
|
|
bashsessionRules,
|
|
))
|
|
|
|
func bashsessionRules() Rules {
|
|
return Rules{
|
|
"root": {
|
|
{`(^[#$%>]\s*)(.*\n?)`, ByGroups(GenericPrompt, Using(Bash)), nil},
|
|
{`^.+\n?`, GenericOutput, nil},
|
|
},
|
|
}
|
|
}
|