-
Notifications
You must be signed in to change notification settings - Fork 842
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
ES|QL highlighting #8317
ES|QL highlighting #8317
Conversation
.token.atrule .token.rule, | ||
.token.keyword { | ||
color: ${codeSyntaxVariables.inlineCodeKeywordColor}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently keyword color is the same as plain inline text color: ${codeSyntaxVariables.inlineCodeColor};
.
This change makes the keywords pop out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, thank you so much for contributing! 😄 I have 2 small comments.
Preview staging links for this PR:
|
💚 Build Succeeded
History
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 👍🏻 Thanks for the awesome job! 💚
@weronikaolejniczak @vadimkibana Did we update our docs accordingly? |
@JasonStoltz are you aware of any doc pages that have to be updated accordingly? |
At a glance, this seems relevant. https://eui.elastic.co/#/editors-syntax/code ![]() ![]() |
`99.2.0-borealis.0` ⏩ `99.3.0-borealis.0` [Questions? Please see our Kibana upgrade FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams) --- ## [`v99.3.0`](https://github.com/elastic/eui/releases/v99.3.0) - Updated table components to support adding tooltips to header cells ([#8273](elastic/eui#8273)) - Added `columns.nameTooltip` on `EuiBasicTable` - Added `tooltipProps` prop on `EuiTableHeaderCell` - Added `accent` color option to `EuiCallOut` ([#8303](elastic/eui#8303)) - Updated `EuiInlineEditForm`'s `onCancel` prop type to allow uncontrolled mode usage ([#8307](elastic/eui#8307)) - Added ES|QL syntax highlighting for `EuiCode`, `EuiCodeBlock`, `EuiMarkdownFormat`, and `EuiMarkdownEditor` components. ([#8317](elastic/eui#8317)) - Updated `EuiAccordion` to prevent content from being transitioned on initial render when `initialIsOpen=true` ([#8327](elastic/eui#8327)) **Bug fixes** - Fixed a bug on `EuiSuperDatePicker` where pasting an absolute date would append the date instead of replace it ([#8311](elastic/eui#8311)) --------- Co-authored-by: Elastic Machine <[email protected]>
`99.2.0-borealis.0` ⏩ `99.3.0-borealis.0` [Questions? Please see our Kibana upgrade FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams) --- ## [`v99.3.0`](https://github.com/elastic/eui/releases/v99.3.0) - Updated table components to support adding tooltips to header cells ([elastic#8273](elastic/eui#8273)) - Added `columns.nameTooltip` on `EuiBasicTable` - Added `tooltipProps` prop on `EuiTableHeaderCell` - Added `accent` color option to `EuiCallOut` ([elastic#8303](elastic/eui#8303)) - Updated `EuiInlineEditForm`'s `onCancel` prop type to allow uncontrolled mode usage ([elastic#8307](elastic/eui#8307)) - Added ES|QL syntax highlighting for `EuiCode`, `EuiCodeBlock`, `EuiMarkdownFormat`, and `EuiMarkdownEditor` components. ([elastic#8317](elastic/eui#8317)) - Updated `EuiAccordion` to prevent content from being transitioned on initial render when `initialIsOpen=true` ([elastic#8327](elastic/eui#8327)) **Bug fixes** - Fixed a bug on `EuiSuperDatePicker` where pasting an absolute date would append the date instead of replace it ([elastic#8311](elastic/eui#8311)) --------- Co-authored-by: Elastic Machine <[email protected]> (cherry picked from commit ac01a0c)
`99.2.0-borealis.0` ⏩ `99.3.0-borealis.0` [Questions? Please see our Kibana upgrade FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams) --- ## [`v99.3.0`](https://github.com/elastic/eui/releases/v99.3.0) - Updated table components to support adding tooltips to header cells ([elastic#8273](elastic/eui#8273)) - Added `columns.nameTooltip` on `EuiBasicTable` - Added `tooltipProps` prop on `EuiTableHeaderCell` - Added `accent` color option to `EuiCallOut` ([elastic#8303](elastic/eui#8303)) - Updated `EuiInlineEditForm`'s `onCancel` prop type to allow uncontrolled mode usage ([elastic#8307](elastic/eui#8307)) - Added ES|QL syntax highlighting for `EuiCode`, `EuiCodeBlock`, `EuiMarkdownFormat`, and `EuiMarkdownEditor` components. ([elastic#8317](elastic/eui#8317)) - Updated `EuiAccordion` to prevent content from being transitioned on initial render when `initialIsOpen=true` ([elastic#8327](elastic/eui#8327)) **Bug fixes** - Fixed a bug on `EuiSuperDatePicker` where pasting an absolute date would append the date instead of replace it ([elastic#8311](elastic/eui#8311)) --------- Co-authored-by: Elastic Machine <[email protected]>
`98.2.2-borealis.0` ⏩ `99.3.0-classic.0` [Questions? Please see our Kibana upgrade FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams) --- ## [`v99.3.0`](https://github.com/elastic/eui/releases/v99.3.0) - Updated table components to support adding tooltips to header cells ([#8273](elastic/eui#8273)) - Added `columns.nameTooltip` on `EuiBasicTable` - Added `tooltipProps` prop on `EuiTableHeaderCell` - Added `accent` color option to `EuiCallOut` ([#8303](elastic/eui#8303)) - Updated `EuiInlineEditForm`'s `onCancel` prop type to allow uncontrolled mode usage ([#8307](elastic/eui#8307)) - Added ES|QL syntax highlighting for `EuiCode`, `EuiCodeBlock`, `EuiMarkdownFormat`, and `EuiMarkdownEditor` components. ([#8317](elastic/eui#8317)) - Updated `EuiAccordion` to prevent content from being transitioned on initial render when `initialIsOpen=true` ([#8327](elastic/eui#8327)) **Bug fixes** - Fixed a bug on `EuiSuperDatePicker` where pasting an absolute date would append the date instead of replace it ([#8311](elastic/eui#8311)) ## [`v99.2.0`](https://github.com/elastic/eui/releases/v99.2.0) - Changed `EuiFieldText` styles to prioritize `disabled` styling over `readonly`. ([#8271](elastic/eui#8271)) - Added `plugs` and `web` glyphs to `EuiIcon` ([#8285](elastic/eui#8285)) - Update `title` on `EuiColorPalettePickerPaletteProps` to be optional ([#8289](elastic/eui#8289)) **Bug fixes** - Fixed an issue with EuiDataGrid with auto row height resulting in a table of 0 height ([#8251](elastic/eui#8251)) - Fixed `disabled` behavior of `EuiFieldText` to prevent input changes. ([#8271](elastic/eui#8271)) ## [`v99.1.0`](https://github.com/elastic/eui/releases/v99.1.0) - Updated `EuiColorPalettePicker` - adds `append` to `EuiColorPalettePickerPaletteProps` to support appending custom content to the title ([#8208](elastic/eui#8208)) - Updated font-weight and font-size of `EuiBetaBadge`s to improve legibility ([#8255](elastic/eui#8255)) - Added support for `titleColor` variant `warning` on `EuiStat` ([#8278](elastic/eui#8278)) ## [`v99.0.0`](https://github.com/elastic/eui/releases/v99.0.0) - Added two new icons: `createGenericJob` and `createGeoJob` ([#8248](elastic/eui#8248)) - Added new icon `section` ([#8261](elastic/eui#8261)) **Bug fixes** - Ensures that the `values` of `EuiI18n` used in `EuiPagination` use `key` attributes to prevent potential ["unique key" warnings](https://react.dev/learn/rendering-lists#keeping-list-items-in-order-with-key). ([#8243](elastic/eui#8243)) **Breaking changes** - Removed `EuiPopover`'s deprecated `hasDragDrop` prop. Use `usePortal` on any child `EuiDraggable` instead ([#8256](elastic/eui#8256)) --------- Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Arturo Castillo Delgado <[email protected]> Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Lene Gadewoll <[email protected]>
## 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" />
## 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)
## 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)
## 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)
#212708) # Backport This will backport the following commits from `main` to `8.18`: - [[Security Assistant] Fix markdown syntax highlighting (#212333)](#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":"[email protected]"},"sourceCommit":{"committedDate":"2025-02-28T01:05:34Z","message":"[Security Assistant] Fix markdown syntax highlighting (#212333)\n\n## Summary\nImplements elastic/eui#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 elastic/eui#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 elastic/eui#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 <[email protected]>
…#212709) # Backport This will backport the following commits from `main` to `8.x`: - [[Security Assistant] Fix markdown syntax highlighting (#212333)](#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":"[email protected]"},"sourceCommit":{"committedDate":"2025-02-28T01:05:34Z","message":"[Security Assistant] Fix markdown syntax highlighting (#212333)\n\n## Summary\nImplements elastic/eui#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 elastic/eui#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 elastic/eui#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 <[email protected]>
…#212710) # Backport This will backport the following commits from `main` to `9.0`: - [[Security Assistant] Fix markdown syntax highlighting (#212333)](#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":"[email protected]"},"sourceCommit":{"committedDate":"2025-02-28T01:05:34Z","message":"[Security Assistant] Fix markdown syntax highlighting (#212333)\n\n## Summary\nImplements elastic/eui#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 elastic/eui#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 elastic/eui#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 <[email protected]>
Closes #212384 ## Summary With elastic/eui#8317, `EuiCodeBlock` supports syntax highlighting for ES|QL. This PR enables it for Obs AI Assistant ### Screenshots Before:  After:  ### Checklist - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
Closes elastic#212384 ## Summary With elastic/eui#8317, `EuiCodeBlock` supports syntax highlighting for ES|QL. This PR enables it for Obs AI Assistant ### Screenshots Before:  After:  ### Checklist - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) (cherry picked from commit 6d862d7)
… (#212765) # Backport This will backport the following commits from `main` to `8.x`: - [[Obs AI Assistant] Enable syntax highlighting for ES|QL (#212669)](#212669) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Viduni Wickramarachchi","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-02-28T12:56:18Z","message":"[Obs AI Assistant] Enable syntax highlighting for ES|QL (#212669)\n\nCloses https://github.com/elastic/kibana/issues/212384\n\n## Summary\n\nWith elastic/eui#8317, `EuiCodeBlock` supports\nsyntax highlighting for ES|QL.\nThis PR enables it for Obs AI Assistant\n\n### Screenshots\n\nBefore:\n\n\nAfter:\n\n\n\n### Checklist\n\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"6d862d72a2358438c5e1295ca004f59cc7115170","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","Team:Obs AI Assistant","backport:version","v9.1.0","v8.19.0"],"title":"[Obs AI Assistant] Enable syntax highlighting for ES|QL","number":212669,"url":"https://github.com/elastic/kibana/pull/212669","mergeCommit":{"message":"[Obs AI Assistant] Enable syntax highlighting for ES|QL (#212669)\n\nCloses https://github.com/elastic/kibana/issues/212384\n\n## Summary\n\nWith elastic/eui#8317, `EuiCodeBlock` supports\nsyntax highlighting for ES|QL.\nThis PR enables it for Obs AI Assistant\n\n### Screenshots\n\nBefore:\n\n\nAfter:\n\n\n\n### Checklist\n\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"6d862d72a2358438c5e1295ca004f59cc7115170"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/212669","number":212669,"mergeCommit":{"message":"[Obs AI Assistant] Enable syntax highlighting for ES|QL (#212669)\n\nCloses https://github.com/elastic/kibana/issues/212384\n\n## Summary\n\nWith elastic/eui#8317, `EuiCodeBlock` supports\nsyntax highlighting for ES|QL.\nThis PR enables it for Obs AI Assistant\n\n### Screenshots\n\nBefore:\n\n\nAfter:\n\n\n\n### Checklist\n\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"6d862d72a2358438c5e1295ca004f59cc7115170"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Viduni Wickramarachchi <[email protected]>
Summary
This change installs and registers ES|QL language syntax for Refractor/Prism.js. To see ES|QL highlighting in action use
"esql"
as the language in React prop or Markdown fenced code block language.This makes (1) inline code block, (2) code block and (3) markdown components support ES|QL highlighting:
This change also changes color of "keyword" tokens in inline code block, otherwise they have the same color as any regular text.
QA