fix(docs-infra): extract header attribute as title in multifile code snippets

The DocViewer component's getCodeSnippetsFromMultifileWrapper method was not
extracting the header attribute from nested <docs-code> elements, causing the
ExampleViewer to fall back to displaying file paths instead of custom headers
in tab labels.

This change adds title extraction from the header attribute when processing
multifile code snippets, ensuring that custom headers are properly displayed
in the code viewer tabs.

Fixes #64760

(cherry picked from commit 5d8b76b4fa)
This commit is contained in:
Shuaib Hasan Akib 2025-10-29 22:25:46 +06:00 committed by Kristiyan Kostadinov
parent 81fcfe5cbc
commit ed500e42e6

View file

@ -222,6 +222,7 @@ export class DocViewer {
sanitizedContent: this.sanitizer.bypassSecurityTrustHtml(tab.innerHTML),
visibleLinesRange: tab.getAttribute('visibleLines') ?? undefined,
shell: tab.classList.contains('shell'),
title: tab.getAttribute('header') ?? undefined,
}));
}