You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/components/code.mdx
+27-1Lines changed: 27 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,10 +66,36 @@ const hello = "world";
66
66
```
67
67
````
68
68
69
+
## Line Highlighting
70
+
71
+
You can highlight specific lines in your code blocks by adding a special comment after the language identifier. Use curly braces `{}` and specify line numbers or ranges separated by commas.
72
+
73
+
```javascript Line Highlighting Example {1,3-5}
74
+
constgreeting="Hello, World!";
75
+
functionsayHello() {
76
+
console.log(greeting);
77
+
}
78
+
sayHello();
79
+
```
80
+
81
+
````md
82
+
```javascript Line Highlighting Example {1,3-5}
83
+
const greeting = "Hello, World!";
84
+
function sayHello() {
85
+
console.log(greeting);
86
+
}
87
+
sayHello();
88
+
```
89
+
````
90
+
69
91
## Code Groups
70
92
71
93
Want to display multiple code examples in one code box? Check out the Code Group docs:
0 commit comments