sempdf v1.9.1Interfaces
Interface: CodeHighlightRule
sempdf / CodeHighlightRule
Defined in: src/types.ts:1321
A regular-expression colouring rule applied to the visual lines of a code block. Rules are evaluated in order and never overwrite a span already claimed by an earlier rule, so put the most specific patterns first (strings and comments before keywords).
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
color? | readonly | ColorInput | Color applied to matched text. Defaults to the block's color. | src/types.ts:1329 |
font? | readonly | PdfFont | Font applied to matched text. Defaults to the block's font. | src/types.ts:1331 |
pattern | readonly | string | RegExp | Pattern to match within each rendered line. A string matches literally; a RegExp is re-created with the g flag (and keeps i/u/s). Patterns are matched per visual line, so they cannot span line breaks. | src/types.ts:1327 |