Skip to content

Commit

Permalink
[Security Assistant] Fix markdown syntax highlighting (elastic#212333)
Browse files Browse the repository at this point in the history
## Summary
Implements elastic/eui#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"
/>

(cherry picked from commit f8ba372)
  • Loading branch information
patrykkopycinski committed Feb 28, 2025
1 parent 17523d1 commit 806c6a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ const getPluginDependencies = ({
customCodeBlock: (props) => {
return (
<>
<CustomCodeBlock value={props.value} />
<CustomCodeBlock value={props.value} lang={props.lang} />
<EuiSpacer size="m" />
</>
);
Expand Down

0 comments on commit 806c6a6

Please sign in to comment.