Commit 38c58bc
fix: prevent grouping consecutive code blocks with the same language (#667)
* fix: prevent grouping consecutive code blocks with the same language
Two consecutive code blocks with the same language (e.g., both `mjs`)
were incorrectly grouped into a CJS/MJS switchable tab. Add a check
to ensure the two code blocks have different languages before creating
a switchable code tab.
Refs: nodejs/node#62181
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: add optional chaining for defensive null safety
* fix: update to assume [0] and [1] always exist
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 84f6dac commit 38c58bc
1 file changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
146 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
147 | 151 | | |
148 | 152 | | |
149 | 153 | | |
| |||
0 commit comments