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

splatter2

What version are you running?

3.0.15

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

/r/nnn/diff/n

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:

<h2>Products</h2>

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

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

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

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

</div>
#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.

chipx86
#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
    +NeedInfo
  • +Release-3.0.x
    +Release-4.0
  • +Component:DiffViewer
#3 splatter2

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