Improper syntax highlighting for restructuredtext in gerrit

Bug #1073211 reported by Dolph Mathews
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Core Infrastructure
Fix Committed
Low
Khai Do

Bug Description

As-is, the current syntax highlighting is distracting at best and misleading at worst.

Here's an RST file in review, for example:
https://review.openstack.org/#/c/14730/3/README.rst

- Randomly bold words break the utility of fixed-width fonts. For example, in the above review, lines 1 and 2 should be the same length according to restructuredtext syntax, but it's hard to judge without consistent character widths.
- Single quotes are treated as string delimiters. For example, the apostrophes used on lines 4 and 15 result in lines 4-15 being highlighted as a quotation.

I'd much prefer any attempt at syntax highlighting be turned off completely for RST files if syntax highlighting can't be performed as expected.

Dolph Mathews (dolph)
description: updated
description: updated
Revision history for this message
Jeremy Stanley (fungi) wrote :

Unsurprisingly, as a Google project, Gerrit embeds a minified http://code.google.com/p/google-code-prettify/ to take care of syntax highlighting... and quite obviously, this lacks a style definition for reStructuredText. In theory we could code up an RST patch for prettify.js (even if it's just one which performs no highlighting), rebuild it, drop the result into the Gerrit source and rebuild that, then get it onto our servers.

In reality this means carrying patches for yet another project (google-code-prettify) until such time as we can get our addition upstreamed, then see it adopted by Gerrit upstream, then upgrade to that version of Gerrit. I'll try to get some consensus on how to prioritize this effort. While technically cosmetic, I understand that it is annoying to the point of actually making it hard to spot real errors (thus negating a lot of the benefit of a code review system in the first place).

James E. Blair (corvus)
Changed in openstack-ci:
status: New → Confirmed
Revision history for this message
Khai Do (zaro0508) wrote :

Gerrit new change screen (available in gerrit 2.8) has allows you to change diff viewer settings. Take a look at the attached image.

Changed in openstack-ci:
assignee: nobody → Khai Do (zaro0508)
Revision history for this message
Khai Do (zaro0508) wrote :

We have upgraded to gerrit 2.8. You can turn off syntax highlight on the gerrit web client if you wish, however this option is only available in the new change screen.

Changed in openstack-ci:
assignee: Khai Do (zaro0508) → nobody
Jeremy Stanley (fungi)
Changed in openstack-ci:
importance: Undecided → Low
Revision history for this message
Khai Do (zaro0508) wrote :

A change to gerrit upstream to support restructured text has merged, https://gerrit-review.googlesource.com/#/c/58680/

Will not be available to openstack until we upgrade gerrit, also still only available on new change screen.

Changed in openstack-ci:
assignee: nobody → Khai Do (zaro0508)
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.