From 5ef2d37c8c03b2845cc37d869e8a610ab5ea9109 Mon Sep 17 00:00:00 2001 From: Alec Thomas Date: Mon, 19 Mar 2018 00:47:15 +1100 Subject: [PATCH] Analysre for PHP. --- lexers/circular/php.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lexers/circular/php.go b/lexers/circular/php.go index 87127a8..d7f8940 100644 --- a/lexers/circular/php.go +++ b/lexers/circular/php.go @@ -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, "