Modify

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#13341 closed defect (fixed)

Syntax Highlighting not preserved

Reported by: ntmlod Owned by: Kate
Priority: normal Component: PreCodeBrowserPlugin
Severity: normal Keywords:
Cc: Trac Release: 1.0

Description (last modified by ntmlod)

The issue is perhaps related to a different release of Trac or Pygments, I don't know.

My CSS rules for syntax highlighting with <pre> tag expect that this tag is contain inside a <div class="code"> but here we have a <div class="searchable">.

So I have coded this raw fix

  • precodebrowser/precodebrowser.py

     
    1111    # ITemplateStreamFilter methods
    1212    def filter_stream(self, req, method, filename, stream, data):
    1313        filter = Transformer('//table[@class = "code"]')
    14         return stream | filter.rename('pre') \
     14        return stream | Transformer('//div[@id = "preview"]').attr('class', 'searchable code') | filter.rename('pre') \
    1515            .select('//pre[@class = "code"]/thead').remove().end() \
    1616            .select('//pre[@class = "code"]/tbody/tr/th').remove().end() \
    1717            .select('//pre[@class = "code"]/tbody/tr/td').append('\n').unwrap()

Attachments (0)

Change History (2)

comment:1 Changed 7 years ago by ntmlod

Description: modified (diff)

comment:2 Changed 7 years ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

In 17032:

PreCodeBrowser 1.0: Fix missing syntax highlighting

Patch by ntmlod.

Fixes #13341.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Kate.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.