Skip to content

[EuiMarkdownFormat] Passing an unknown language to a code block crashes the Markdown renderer #8728

@tkajtoch

Description

@tkajtoch

Describe the bug

When an unknown (unregistered) language is passed to a code block, the component falls back to rendering passed children as plain text with no Markdown formatting applied.

Impact and severity

This is a user-facing issue that has been reported internally.

Environment and versions

  • EUI version: 102.2.0
  • React version: 18.2
  • Kibana version (if applicable): N/A
  • Browser: N/A
  • Operating System: N/A

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://eui.elastic.co/docs/components/editors-and-syntax/markdown/format/#built-in-plugins
  2. Edit the markdownContent variable value to:
    # Hello, World!
    ~~~blah
    console.log(123);
    ~~~
    
  3. See the whole Markdown content being rendered as plain text with no Markdown formatting applied to either the heading or the code block

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions