Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-9036

Handlebars syntax highlighting does not take affect

XMLWordPrintable

      Summary

      Configuring the file extensions for Handlebars syntax highlighting does not take affect and the text does not receive any highlighting. 

      Steps to Reproduce

      1. In bitbucket.properties add syntax.highlighter.text/x-handlebars-template.extensions=hbs
      2. Restart Bitbucket Server
      3. Add the below code to a test.hbs file, commit, and push it to a repository
      4. Browse to the file
        {{> breadcrumbs}}
        
        {{!--
         You can use the t function to get
         content translated to the current locale, es:
         {{t 'article_list'}}
        --}}
        
        <h1>{{t 'article_list'}}</h1>
        
        {{! one line comment }}
        
        {{#each articles}}
         {{~title}}
         <p>{{excerpt body size=120 ellipsis=true}}</p>
        
         {{#with author}}
         written by {{first_name}} {{last_name}}
         from category: {{../category.title}}
         {{#if @../last}}foobar!{{/if}}
         {{/with~}}
        
         {{#if promoted.latest}}Read this one! {{else}} This is ok! {{/if}}
        
         {{#if @last}}<hr>{{/if}}
        {{/each}}
        
        {{#form new_comment}}
         <input type="text" name="body">
        {{/form}}
        

      Expected Results

      Code is highlighted as seen on https://codemirror.net/mode/handlebars/index.html

      Actual Results

      Code is not highlighted

              mmcglynn Michael McGlynn (Inactive)
              jethomas Jeff Thomas
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: