4835: Diff View syntax highlighting broken for Angular html template files


What version are you running?


What's the URL of the page containing the problem?


What steps will reproduce the problem?

  1. Include an angular html template file in the review request.
  2. Go to diff tab.

What is the expected output? What do you see instead?

Diff should display normally. Instead there are strange artifacts shown for some Angular directives such as the asterisk (*) and brackets (both square and curved - [], ())

Please provide any additional information below.

Sample Angular HTML template:


<div *ngFor="let product of products">

    <a [title]="product.name + ' details'">
      {{ product.name }}

  <p *ngIf="product.description">
    Description: {{ product.description }}

  <button (click)="share()">

#1 splatter2

Looks like the emails from beanbag suffer from the same problem. Attached is a screen shot of the html template as displayed in the email sent to me from beanbag.

#2 chipx86

We use Pygments for all syntax highlighting, which does support the highlighting, but we currently choose a lexer based on filename and not the content. The reason is that for a long time, some file types (large XML-based documents in particular) were so slow to guess that Pygments would sometimes stall Apache threads. I don't believe this is a problem anymore, so we probably will want to move to content-based lexer selection, but probably not until Review Board 4.0, due to the significant behavior change (which I'm sure will cause other regressions).

What file extension are you using for these files? Just .html?

  • -New
  • +Release-3.0.x
  • +Component:DiffViewer
#3 splatter2

@chipx86, Yes, the file extension is just .html.