Labels are not rendered in group-level Wiki

Summary

Only in a group-level wiki, a label is not rendered properly when added to a wiki page. The label is rendered in the Preview pane but appears without any styling once changes have been saved.

Steps to reproduce

  1. Create or edit a page in a group-level wiki, if you do not already have one
  2. Add some content to a page that includes a reference to the label (See the snippet below.)
  3. Click Preview
  4. Observe that the label is rendered and shown in color
  5. Click Save changes
  6. Observe that the label is rendered as plain text without any styling

This is illustrated in the screenshot below:

label-group-wiki-saved-changes

This happens with labels, whether or not they are scoped labels.

Sample content to add to reproduce this behavior

Copy this text into a group-level wiki to reproduce:

This is a label: ~"supportgitlabgold::testing" and here is another: ~"alittlelabel" 

Note that this does work properly in a project-level wiki, as shown below:

instance-level-wiki-image-labels

Example Project

This undesired behavior happens with a group-level wiki. Here is a link to a group-level wiki page where this behavior has been reproduced:

View the project-level wiki where this works on GitLab.com at:

What is the current bug behavior?

The reference to the label name is not rendered with any formatting. See:

What is the expected correct behavior?

The reference for the label name should be rendered in color. This would match the behavior with project-level wikis.

This is a project-level wiki on GitLab.com where this works properly:

Relevant logs and/or screenshots

When writing on the Wiki:

label-group-wiki-write

When previewing that content:

label-group-wiki-preview

Once the changes have been saved:

label-group-wiki-saved-changes

Output of checks

This bug happens on GitLab.com.

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

Edited by Brie Carranza