Skip to content

Fix explain code text selection for unsupported languages

Jacques Erasmus requested to merge 416366-fix-explain-code-selection into master

What does this MR do and why?

Ensures content that cannot be highlighted by highlight.js is rendered as plain text.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
Screenshot_2023-07-10_at_10.01.54 Screenshot_2023-07-10_at_10.02.17

How to set up and validate locally

  1. Enable the explain code feature flags
  2. Open source code that cannot be highlighted by highlight.js (sample.vue)
  3. Select the content and click the explain code button
  4. The selected content should be rendered as plain text

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #416366 (closed)

Merge request reports