package lexers import ( . "github.com/alecthomas/chroma/v2" // nolint ) // Svelte lexer. var Svelte = Register(DelegatingLexer(HTML, MustNewLexer( &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 {`(?