Syntax highlight changes

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

In Bitbucket Server 3.5 the mechanism for code highlighting has changed, HighlightJS has been replaced by CodeMirror and is no longer supported. Any custom languages you may have added will no longer work. If you have set up custom file extension or executable mappings for HighlightJS, these will need to migrated to the new format. The old format will stop working in Bitbucket Server 4.0.

The new mappings are detailed in Configuring syntax highlighting for file extensions.

Migrating from the old mapping format to the new mapping format is relatively easy. For example, If you have old PERL mappings:

bitbucket.properties

1 2 syntax.highlighter.perl.executables=perl syntax.highlighter.perl.extensions=pl,pm

You just need to change the "perl" part of both the definitions to the MIME type "text/x-perl" so that it looks like:

bitbucket.properties

1 2 syntax.highlighter.text/x-perl.executables=perl syntax.highlighter.text/x-perl.extensions=pl,pm

After updating your bitbucket.properties file you'll need to restart Bitbucket Server for the configuration to take effect. See Configuration properties.

A full list of the supported modes in CodeMirror and their MIME types can be found in the CodeMirror repository. As of the time of writing, Bitbucket Server uses CodeMirror 4.7.0, however we offer no stability guarantee, and may update CodeMirror versions in any release.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.