mirror of
https://gitea.com/gitea/tea.git
synced 2024-12-21 00:25:06 +01:00
89e93d90b3
Merge branch 'master' into use-glamour select Glamour Theme based on BackgroundColor Merge branch 'master' into use-glamour Merge branch 'master' into use-glamour update termev update go.mod label color colorate use glamour for issue content Vendor: Add glamour Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/tea/pulls/181 Reviewed-by: techknowlogick <techknowlogick@gitea.io> Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
39 lines
1.2 KiB
Go
39 lines
1.2 KiB
Go
package a
|
|
|
|
import (
|
|
. "github.com/alecthomas/chroma" // nolint
|
|
"github.com/alecthomas/chroma/lexers/internal"
|
|
)
|
|
|
|
// Apacheconf lexer.
|
|
var Apacheconf = internal.Register(MustNewLexer(
|
|
&Config{
|
|
Name: "ApacheConf",
|
|
Aliases: []string{"apacheconf", "aconf", "apache"},
|
|
Filenames: []string{".htaccess", "apache.conf", "apache2.conf"},
|
|
MimeTypes: []string{"text/x-apacheconf"},
|
|
CaseInsensitive: true,
|
|
},
|
|
Rules{
|
|
"root": {
|
|
{`\s+`, Text, nil},
|
|
{`(#.*?)$`, Comment, nil},
|
|
{`(<[^\s>]+)(?:(\s+)(.*?))?(>)`, ByGroups(NameTag, Text, LiteralString, NameTag), nil},
|
|
{`([a-z]\w*)(\s+)`, ByGroups(NameBuiltin, Text), Push("value")},
|
|
{`\.+`, Text, nil},
|
|
},
|
|
"value": {
|
|
{`\\\n`, Text, nil},
|
|
{`$`, Text, Pop(1)},
|
|
{`\\`, Text, nil},
|
|
{`[^\S\n]+`, Text, nil},
|
|
{`\d+\.\d+\.\d+\.\d+(?:/\d+)?`, LiteralNumber, nil},
|
|
{`\d+`, LiteralNumber, nil},
|
|
{`/([a-z0-9][\w./-]+)`, LiteralStringOther, nil},
|
|
{`(on|off|none|any|all|double|email|dns|min|minimal|os|productonly|full|emerg|alert|crit|error|warn|notice|info|debug|registry|script|inetd|standalone|user|group)\b`, Keyword, nil},
|
|
{`"([^"\\]*(?:\\.[^"\\]*)*)"`, LiteralStringDouble, nil},
|
|
{`[^\s"\\]+`, Text, nil},
|
|
},
|
|
},
|
|
))
|