docs: note .sass routes through SCSS lexer
This commit is contained in:
@@ -64,7 +64,7 @@ The legacy `removeCommentsFromLine` path is retained only as the fallback descri
|
|||||||
## Lexer resolution
|
## Lexer resolution
|
||||||
|
|
||||||
1. `lexer := lexers.Match("f." + ext)` (drive by extension so behavior matches shush's `languageMap`, not chroma's content analysis).
|
1. `lexer := lexers.Match("f." + ext)` (drive by extension so behavior matches shush's `languageMap`, not chroma's content analysis).
|
||||||
2. Override map for known gaps: `less` → `lexers.Get("SCSS")` (identical `//` + `/* */` comment syntax; chroma has no Less lexer).
|
2. Override map for known gaps: `less` and `sass` → `lexers.Get("SCSS")` (chroma has no Less lexer; chroma's indented-Sass lexer lacks a multi-line `/* */` rule — both share `//` + `/* */` comment syntax and tokenise losslessly through SCSS).
|
||||||
3. If still nil, **fall back to the existing hand-rolled `languageMap` remover.** The only uncovered extension is `conf` (line comments only), which the legacy remover handles correctly — the multi-line block bug cannot occur for line-only languages.
|
3. If still nil, **fall back to the existing hand-rolled `languageMap` remover.** The only uncovered extension is `conf` (line comments only), which the legacy remover handles correctly — the multi-line block bug cannot occur for line-only languages.
|
||||||
4. `lexer = chroma.Coalesce(lexer)` before tokenising.
|
4. `lexer = chroma.Coalesce(lexer)` before tokenising.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user