Update syntax highlighting logic [RUN ALL RSPEC] [RUN AS-IF-FOSS]

Merged Vasilii Iakliushin requested to merge 16950_rework_syntax_highlighting into master

What does this MR do?

Contributes to #16950 (closed)

We apply syntax highlighting to old and new versions of the whole file. However, we only need to highlight requested diff lines.

This change should optimize this process. Here we provide only necessary diff lines to the syntax highlighter.

Screenshots (strongly suggested)

Does this MR meet the acceptance criteria?


Availability and Testing


If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • 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 🤖 GitLab Bot 🤖