sempdf
sempdf v1.9.1Interfaces

Interface: CodeHighlightRule

sempdf v1.9.1


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

PropertyModifierTypeDescriptionDefined in
color?readonlyColorInputColor applied to matched text. Defaults to the block's color.src/types.ts:1329
font?readonlyPdfFontFont applied to matched text. Defaults to the block's font.src/types.ts:1331
patternreadonlystring | RegExpPattern 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

On this page