diff --git a/packages/shared-ux/markdown/impl/markdown.tsx b/packages/shared-ux/markdown/impl/markdown.tsx index 6793e4c8a6099..f1f93eb1a9a60 100644 --- a/packages/shared-ux/markdown/impl/markdown.tsx +++ b/packages/shared-ux/markdown/impl/markdown.tsx @@ -6,7 +6,13 @@ * Side Public License, v 1. */ -import { EuiLink, EuiMarkdownEditor, EuiMarkdownEditorProps, EuiMarkdownFormat, getDefaultEuiMarkdownProcessingPlugins } from '@elastic/eui'; +import { + EuiLink, + EuiMarkdownEditor, + EuiMarkdownEditorProps, + EuiMarkdownFormat, + getDefaultEuiMarkdownProcessingPlugins, +} from '@elastic/eui'; import React, { useState } from 'react'; export type MarkdownProps = Partial< @@ -41,9 +47,7 @@ export const Markdown = ({ // openLinksInNewTab functionality from https://codesandbox.io/s/relaxed-yalow-hy69r4?file=/demo.js:482-645 const processingPlugins = getDefaultEuiMarkdownProcessingPlugins(); - processingPlugins[1][1].components.a = (props) => ( - - ); + processingPlugins[1][1].components.a = (props) => ; // Render EuiMarkdownFormat when readOnly set to true if (readOnly) { @@ -51,7 +55,10 @@ export const Markdown = ({ throw new Error('Markdown content is required in [readOnly] mode'); } return ( - + {children ?? markdownContent!} ); diff --git a/packages/shared-ux/markdown/impl/markdown_format.stories.tsx b/packages/shared-ux/markdown/impl/markdown_format.stories.tsx index 2368ac442e75a..ed0a575c0192b 100644 --- a/packages/shared-ux/markdown/impl/markdown_format.stories.tsx +++ b/packages/shared-ux/markdown/impl/markdown_format.stories.tsx @@ -32,12 +32,14 @@ export const MarkdownStoryComponent = (params: MarkdownStorybookParams) => { - {'My content in **markdown** format passed as *children* [test link to open in new tab or not](https://www.elastic.co)'} + { + 'My content in **markdown** format passed as *children* [test link to open in new tab or not](https://www.elastic.co)' + } diff --git a/packages/shared-ux/markdown/mocks/storybook.ts b/packages/shared-ux/markdown/mocks/storybook.ts index 7b915a69deebf..3ed41273764ed 100644 --- a/packages/shared-ux/markdown/mocks/storybook.ts +++ b/packages/shared-ux/markdown/mocks/storybook.ts @@ -11,7 +11,12 @@ import type { MarkdownProps } from '@kbn/shared-ux-markdown-types'; type PropArguments = Pick< MarkdownProps, - 'readOnly' | 'placeholder' | 'markdownContent' | 'height' | 'ariaLabelContent' | 'openLinksInNewTab' + | 'readOnly' + | 'placeholder' + | 'markdownContent' + | 'height' + | 'ariaLabelContent' + | 'openLinksInNewTab' >; export type Params = Record;