Custom Components
Code Block - Line Highlighting
Enabling line highlighting in code blocks
#Line Highlighting
Enabling line highlighting in code blocks
#Code Example
Show line highlighting using the {<line_number>} meta tag.
```ts {2}
interface User {
id: number;
name: string;
}
```It will be rendered as:
interface User {
id: number;
name: string;
}#Multiple Line Highlighting
You can highlight multiple lines by using {<line_number>,<line_number>} meta tags.
```ts {2,4}
interface User {
id: number;
name: string;
}
```It will be rendered as:
interface User {
id: number;
name: string;
}#Range of Line Highlighting
Or you can use range of line number like {<start>-<end>}.
```ts {2-4}
interface User {
id: number;
name: string;
}
```It will be rendered as:
interface User {
id: number;
name: string;
}