[Security Assistant] Fix markdown syntax highlighting (#212333)

## Summary
Implements https://github.com/elastic/eui/pull/8317 

Before: 
<img width="1007" alt="image"
src="https://github.com/user-attachments/assets/649a075a-7338-434b-9e2e-4c4fd0d6ca6f"
/>

After:
<img width="1484" alt="image"
src="https://github.com/user-attachments/assets/cdb27885-e009-49aa-9b1a-381e12c33727"
/>
This commit is contained in:
Patryk Kopyciński 2025-02-28 02:05:34 +01:00 committed by GitHub
parent c0c64a8489
commit f8ba372106
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -8,7 +8,7 @@ import { EuiCodeBlock, EuiFlexGroup, EuiFlexItem, EuiPanel, useEuiTheme } from '
import { css } from '@emotion/css';
import React from 'react';
export const CustomCodeBlock = ({ value }: { value: string }) => {
export const CustomCodeBlock = ({ value, lang }: { value: string; lang: string }) => {
const theme = useEuiTheme();
return (
@ -31,7 +31,7 @@ export const CustomCodeBlock = ({ value }: { value: string }) => {
>
<EuiFlexGroup direction="column" gutterSize="xs">
<EuiFlexItem grow={false}>
<EuiCodeBlock isCopyable fontSize="m">
<EuiCodeBlock isCopyable fontSize="m" language={lang}>
{value}
</EuiCodeBlock>
</EuiFlexItem>

View file

@ -132,7 +132,7 @@ const getPluginDependencies = ({
customCodeBlock: (props) => {
return (
<>
<CustomCodeBlock value={props.value} />
<CustomCodeBlock value={props.value} lang={props.lang} />
<EuiSpacer size="m" />
</>
);