Skip to content

Commit

Permalink
revert change to shared UX markdown component for dashboard vis
Browse files Browse the repository at this point in the history
  • Loading branch information
eokoneyo committed Apr 16, 2024
1 parent ce01620 commit 632095c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/plugins/vis_type_markdown/kibana.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
],
"requiredBundles": [
"expressions",
"kibanaReact",
"visDefaultEditor",
"visualizations"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ describe('markdown vis controller', () => {

expect(getByText('markdown')).toMatchInlineSnapshot(`
<a
class="euiLink emotion-euiLink-primary"
href="http://daringfireball.net/projects/markdown"
rel="noreferrer"
>
markdown
</a>
Expand All @@ -55,8 +53,7 @@ describe('markdown vis controller', () => {

expect(getByText(/testing/i)).toMatchInlineSnapshot(`
<p>
Testing
html
Testing &lt;a&gt;html&lt;/a&gt;
</p>
`);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import React, { useEffect } from 'react';
import { Markdown } from '@kbn/shared-ux-markdown';
import { Markdown } from '@kbn/kibana-react-plugin/public';
import { MarkdownVisParams } from './types';

import './markdown_vis.scss';
Expand All @@ -29,8 +29,7 @@ const MarkdownVisComponent = ({
<Markdown
data-test-subj="markdownBody"
openLinksInNewTab={openLinksInNewTab}
markdownContent={markdown || ` `}
readOnly
markdown={markdown}
/>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expect(h1Txt).to.equal('Heading 1');
});

it('should not render html in markdown', async function () {
it('should not render html in markdown as html', async function () {
const actual = await PageObjects.visChart.getMarkdownText();
expect(actual).to.equal('Heading 1');

expect(actual).to.equal(
'Heading 1\n<h3>Inline HTML that should not be rendered as html</h3>'
);
});

it('should auto apply changes if auto mode is turned on', async function () {
Expand Down

0 comments on commit 632095c

Please sign in to comment.