Custom Components

Code Block - Error and Warning Lines

Enabling error and warning lines in code blocks


Error and Warning Lines

Error and warning lines is a way show the line that you want to highlight as error or warning.

Code Example

Show error and warning lines using the // [!code error] and // [!code warning] identifier.

mdx
```bash showLineNumbers
console.log("Normal")
console.error("Error") //[!code error]
console.warning("Warning") //[!code warning]
```

It will show like this

ts
console.log("Normal")
console.error("Error") 
console.warning("Warning")