Code with Highlighted Lines

Highlight specific lines in code blocks to draw attention to important code sections, changes, or key concepts.

Syntax

Use data-line attribute after the language identifier:

```console-data-line="1-2, 5, 9-20"
```

Parameters

Example

function processData(input) {
    const cleaned = input.trim();        // Highlighted
    const parsed = JSON.parse(cleaned);  // Highlighted
    
    if (parsed.valid) {
        return parsed.data;  // Highlighted
    }
    
    return null;
}