mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
This sync some of the changes we have on the main branch will allow more upcomming changes to land via a single PR. PR Close #63394
21 lines
767 B
TypeScript
21 lines
767 B
TypeScript
/*!
|
|
* @license
|
|
* Copyright Google LLC All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
* found in the LICENSE file at https://angular.dev/license
|
|
*/
|
|
|
|
import {h} from 'preact';
|
|
import {RawHtml} from './raw-html';
|
|
import {codeToHtml} from '../../../shared/shiki.mjs';
|
|
import {get} from 'http';
|
|
import {getHighlighterInstance} from '../shiki/shiki.mjs';
|
|
|
|
/** Component to render a header of the CLI page. */
|
|
export function HighlightTypeScript(props: {code: string}) {
|
|
const result = codeToHtml(getHighlighterInstance(), props.code, 'typescript');
|
|
const withScrollTrack = result.replace(/^(<pre class="shiki)/, '$1 docs-mini-scroll-track');
|
|
|
|
return <RawHtml value={withScrollTrack} className="docs-code" />;
|
|
}
|