Opened 10 years ago

Closed 6 years ago

Trac-hacks.org does not render ReStructuredText

Reported by: Owned by: Emmanuel Blot Matt Good high TracPygmentsPlugin major th07@… 0.10

Description

See WikiRestructuredText for example. This breaks display of pages hosted on Trac Hacks.

It seems that Pygments takes precedence over Docutils for some reason.

However, quality ratio is defined to 7 for Pygments in TracPygmentsPlugin, whereas Trac's rst.py defines a quality ratio of 8.

I've not been able to reproduce this error on a local installation with the latest 0.10 Trac version, docutils 0.4 (the same as on http://trac-hacks.org) and Pygments 0.7.1

comment:1 Changed 10 years ago by anonymous

+1 here. Trac-0.10.4 Pygments-0.7.1

Adding [components] tracpygments.* = enabled to trac.ini break restructured text rendering on my local installation

comment:2 Changed 10 years ago by haizaar@…

Sorry for commenting twice - forgot to set email

+1 here. Trac-0.10.4 Pygments-0.7.1

Adding [components] tracpygments.* = enabled to trac.ini break restructured text rendering on my local installation

comment:3 Changed 10 years ago by Alec Thomas

Component: TracHacks → TracPygmentsPlugin changed from Alec Thomas to Matt Good

This is fixed on TracHacks with a hack, but I'm not sure what the long term fix is.

The problem is that Trac doesn't use the MIME system for rendering highlighted blocks, it's simply a macro call. TracPygmentsPlugin registers a macro for each "short name" Pygments knows about, rst included. This takes precedence over the builtin rst macro and we end up with ReStructuredText not rendering correctly.

I'm going to reassign this to TracPygmentsPlugin, as it's not a problem with TracHacks. Not sure what the correct fix is, whether it be in Trac or the plugin.

comment:4 Changed 9 years ago by anonymous

This same happens when I would like to have Trac to render diff? Table format is much more better for my stakeholders than pygments color coding... Please propose patches, which would help here...

Changed 9 years ago by Markus Pelkonen

I use this hack to fix the issue in my environments

comment:5 Changed 9 years ago by anonymous

fix_trac_rst_and_diff.patch takes out syntax highlighting completely. [fix_trac_rst_and_diff_2.patch] patch fixes the problem and at the same time leaves syntax highlighting for restructured (use rest, restructured macros).

comment:6 Changed 6 years ago by Ryan J Ollos

Resolution: → wontfix new → closed

Closing ticket since plugin is unmaintained and support can be found by upgrading to Trac 0.11.

Modify Ticket

Action
as closed The owner will remain Matt Good.
The resolution will be deleted. Next status will be 'reopened'.