Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.14] revert change to shared UX markdown component for dashboard vis (#180906) #181140

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion src/plugins/vis_type_markdown/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@kbn/i18n",
"@kbn/i18n-react",
"@kbn/config-schema",
"@kbn/shared-ux-markdown",
"@kbn/kibana-react-plugin",
],
"exclude": [
"target/**/*",
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
Loading