public highlight(line as String) as List<StyledSpan>
Tokenizes and styles a single line of source code from the default LexicalState.NORMAL state.
| Parameter | Description |
|---|---|
line | Source line text. |
Ordered list of StyledSpan segments whose concatenation equals line.
import klyn.code.highlighters
spans = CodeHighlighter(["if"], "//").highlight("if (x > 0)")