mirror of
https://github.com/alecthomas/chroma.git
synced 2025-03-17 20:58:08 +02:00
Analysre for PHP.
This commit is contained in:
parent
b21a6da792
commit
5ef2d37c8c
@ -1,6 +1,8 @@
|
||||
package circular
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
. "github.com/alecthomas/chroma" // nolint
|
||||
"github.com/alecthomas/chroma/lexers/h"
|
||||
"github.com/alecthomas/chroma/lexers/internal"
|
||||
@ -81,4 +83,9 @@ var PHP = internal.Register(DelegatingLexer(h.HTML, MustNewLexer(
|
||||
{`[${\\]`, LiteralStringDouble, nil},
|
||||
},
|
||||
},
|
||||
)))
|
||||
).SetAnalyser(func(text string) float32 {
|
||||
if strings.Contains(text, "<?php") {
|
||||
return 0.5
|
||||
}
|
||||
return 0.0
|
||||
})))
|
||||
|
Loading…
x
Reference in New Issue
Block a user