Add terraform file support for blob viewer in repository (Highlight.js)

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

  • Work on this issue
  • Close this issue

Summary

Gitlab file viewer often highlights a dot with red background. It does not seem to be a Unicode extended character as discussed in #16683 (closed) or some other unprintable characters affecting this.

Steps to reproduce

Create a test.tf, add a line like environment = data.terraform in it.

Example Project

https://gitlab.com/richlv/gitlab-test/-/blob/main/test.tf

What is the current bug behavior?

The dot is highlighted in red.

What is the expected correct behavior?

The dot is not highlighted.

Relevant logs and/or screenshots

image

This bug happens on GitLab.com

Proposal

Syntax highlighting support can be added to the blob viewer by following the guide for Adding syntax highlighting support.

There is a separate Terraform Library for Highlight JS which is located here: https://github.com/highlightjs/highlightjs-terraform

Edited Jul 07, 2025 by Kai Armstrong
Assignee Loading
Time tracking Loading