Review Board Ticket #4835: Diff View syntax highlighting broken for Angular html template files

7 views
Skip to first unread message

sholl...@gmail.com

unread,
Jul 11, 2019, 1:10:24 PM7/11/19
to sholl...@gmail.com, reviewboa...@googlegroups.com
To reply, visit https://hellosplat.com/s/beanbag/tickets/4835/

New ticket #4835 by splatter2

For Beanbag, Inc. Review Board

Diff View syntax highlighting broken for Angular html template files

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>

New Priority:Medium Type:Defect

sholl...@gmail.com

unread,
Jul 11, 2019, 11:53:40 PM7/11/19
to sholl...@gmail.com, reviewboa...@googlegroups.com

New update by splatter2

For Beanbag, Inc. Review Board Ticket #4835

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.

Files:
+

Screenshot.png

Christian Hammond

unread,
Jul 13, 2019, 12:20:25 AM7/13/19
to Christian Hammond, sholl...@gmail.com, reviewboa...@googlegroups.com

New update by 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?

Status:
- New
+ NeedInfo
Milestones:
+ Release-3.0.x
+ Release-4.0
Tags:
+ Component:DiffViewer

sholl...@gmail.com

unread,
Jul 15, 2019, 12:07:44 AM7/15/19
to sholl...@gmail.com, reviewboa...@googlegroups.com

New update by splatter2

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

Reply all
Reply to author
Forward
0 new messages