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

# Backport

This will backport the following commits from `main` to `9.0`:
- [[Security Assistant] Fix markdown syntax highlighting
(#212333)](https://github.com/elastic/kibana/pull/212333)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Patryk
Kopyciński","email":"contact@patrykkopycinski.com"},"sourceCommit":{"committedDate":"2025-02-28T01:05:34Z","message":"[Security
Assistant] Fix markdown syntax highlighting (#212333)\n\n##
Summary\nImplements https://github.com/elastic/eui/pull/8317 \n\nBefore:
\n<img width=\"1007\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/649a075a-7338-434b-9e2e-4c4fd0d6ca6f\"\n/>\n\nAfter:\n<img
width=\"1484\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/cdb27885-e009-49aa-9b1a-381e12c33727\"\n/>","sha":"f8ba3721061de8fe5789eaeb59fcf94b99f0fc05","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"[Security
Assistant] Fix markdown syntax
highlighting","number":212333,"url":"https://github.com/elastic/kibana/pull/212333","mergeCommit":{"message":"[Security
Assistant] Fix markdown syntax highlighting (#212333)\n\n##
Summary\nImplements https://github.com/elastic/eui/pull/8317 \n\nBefore:
\n<img width=\"1007\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/649a075a-7338-434b-9e2e-4c4fd0d6ca6f\"\n/>\n\nAfter:\n<img
width=\"1484\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/cdb27885-e009-49aa-9b1a-381e12c33727\"\n/>","sha":"f8ba3721061de8fe5789eaeb59fcf94b99f0fc05"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/212333","number":212333,"mergeCommit":{"message":"[Security
Assistant] Fix markdown syntax highlighting (#212333)\n\n##
Summary\nImplements https://github.com/elastic/eui/pull/8317 \n\nBefore:
\n<img width=\"1007\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/649a075a-7338-434b-9e2e-4c4fd0d6ca6f\"\n/>\n\nAfter:\n<img
width=\"1484\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/cdb27885-e009-49aa-9b1a-381e12c33727\"\n/>","sha":"f8ba3721061de8fe5789eaeb59fcf94b99f0fc05"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Patryk Kopyciński <contact@patrykkopycinski.com>
This commit is contained in:
Kibana Machine 2025-02-28 15:43:37 +11:00 committed by GitHub
parent 3723575f28
commit 6a5379d34a
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" />
</>
);