Comment blocks in SQL files lead to incorrect highlighting in web viewer

Summary

When using comment blocks in SQL files, the highlighting will break in the web viewer (not the editor or web IDE) if the comment block begins with a line of asterisks which is not terminated with a trailing slash. It seems that the viewer believes that the block is not finished and highlights the rest of the document as if it was a comment. It is my understanding that the behavior seen in the editor and web IDE is the correct behavior.

Steps to reproduce

  1. Create an SQL file containing a comment block like this:
/***************************************************************************************************

/*  If count < 25000 stop processing incomplete file

/***************************************************************************************************/
  1. Include any uncommented SQL code above and below the comment block.

  2. Commit and review in the web viewer. Notice the difference from what is shown in the editor.

  3. Add a trailing / to the first line of the comment block.

  4. Commit and review in the web viewer. Notice that the web viewer and the editor both show the rest of the code highlighted correctly.

Example Project

Example of problem: https://gitlab.com/calebcooper/sql-comments/-/blob/main/customer-example.sql

What is the current bug behavior?

Comment blocks do not require a trailing slash at the end of the first line, and the web viewer is incorrectly rendering highlighting as if this slash is required.

What is the expected correct behavior?

Comment blocks without a trailing slash at the end of the first line should not break highlighting.

Relevant logs and/or screenshots

Incorrect behavior in web viewer: 1271-sql-comment-block-highlighting-view

Correct behavior in editor: 1271-sql-comment-block-highlighting-edit

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes