Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion src/components/onboarding/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,27 @@ export function updateElementsVisibilityForOptions(
const codeBlock = openLine.closest('code.code-highlight');
if (!codeBlock) return;

const allLines = Array.from(codeBlock.children) as HTMLElement[];
// Helper function to get all code lines, including those nested in HighlightBlocks
const getAllCodeLines = (container: Element): HTMLElement[] => {
const lines: HTMLElement[] = [];
Array.from(container.children).forEach(child => {
const el = child as HTMLElement;
// If it's a highlight-block, get lines from inside it
if (el.classList.contains('highlight-block')) {
// Lines are nested in highlight-block > div (CodeLinesContainer)
const linesContainer = el.querySelector('div');
if (linesContainer) {
lines.push(...(Array.from(linesContainer.children) as HTMLElement[]));
}
} else {
// Regular line, add it directly
lines.push(el);
}
});
return lines;
};

const allLines = getAllCodeLines(codeBlock);
const openIndex = allLines.indexOf(openLine);

// Find the matching close line in the same code block
Expand Down
Loading