package s import ( . "github.com/alecthomas/chroma" // nolint "github.com/alecthomas/chroma/lexers/h" "github.com/alecthomas/chroma/lexers/internal" "github.com/alecthomas/chroma/lexers/t" ) // Svelte lexer. var Svelte = internal.Register(DelegatingLexer(h.HTML, MustNewLazyLexer( &Config{ Name: "Svelte", Aliases: []string{"svelte"}, Filenames: []string{"*.svelte"}, MimeTypes: []string{"application/x-svelte"}, DotAll: true, }, svelteRules, ))) func svelteRules() Rules { return Rules{ "root": { // Let HTML handle the comments, including comments containing script and style tags {``, Other, Pop(1)}, {`.+?`, Other, nil}, }, "templates": { {`}`, Punctuation, Pop(1)}, // Let TypeScript handle strings and the curly braces inside them {`(?