Skip to content

Draft: Introduced the code block component with highlightjs

Denys Mishunov requested to merge dmishunov/code-snippet-highlightjs into master

What does this MR do?

Introduces the code block Vue component that renders the code snippets with the highlighting using highlights.

This is a part of a series of experiments of rendering the code blocks in the product using different approaches:

  1. Using Source Editor with the specially designed read-only extension
  2. Using Monaco's highlighting directly without the editor itself
  3. Using highlights (this MR)

To test any of the MRs above, one needs to enable the :refactor_blob_viewer feature flag.

Screenshots or Screencasts (strongly suggested)

JS file Ruby file
Screenshot_2021-08-20_at_16.39.25 Screenshot_2021-08-20_at_16.49.39

Keep in mind — we might tweak the visual themes, but not so much

How to setup and validate locally (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Denys Mishunov

Merge request reports