ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

Multi-line tokens not highlighted in file views (Bug #450)


Added by Kornelius Kalnbach at 2011-06-05 03:50 pm. Updated at 2011-06-07 08:47 am.


Status:Needs more information Start date:2011-06-05
Priority:Normal Due date:
Assignee:Kornelius Kalnbach % Done:

0%

Category:Text formatting
Target version:-
Remote issue URL: Affected version:

Description

Looking at https://www.chiliproject.org/projects/chiliproject/repository/revisions/master/entry/vendor/gems/coderay-0.9.7/lib/coderay/scanners/ruby/patterns.rb#L7, you can see that the file viewer seems to cut the source code into lines before sending them to CodeRay.

The file should be sent in one piece to the highlighter, which would make highlighting faster and better.


fixed-multi-line-tokens.png (23.7 kB) Kornelius Kalnbach, 2011-06-05 07:38 pm


History

Updated by Kornelius Kalnbach at 2011-06-05 07:38 pm

A screenshot of a fixed page.

  • File fixed-multi-line-tokens.png added

Updated by Kornelius Kalnbach at 2011-06-05 07:38 pm

  • Status changed from Open to Ready for review

Updated by Holger Just at 2011-06-06 08:09 pm

I don't know if it is a good idea to "parse" HTML using regexes to make lines stand on their own. This feels like a kludge to me (although your code looks impressive). I feel this is something that should be done in the highlighter (like e.g. pygments does it)

How do you think about that? Maybe an additional feature for CodeRay 1.0? :)

  • Status changed from Ready for review to Needs more information

Updated by Kornelius Kalnbach at 2011-06-07 08:36 am

CodeRay always had an option for line numbers. Why Redmine didn't use it I don't know.

The code I used is actually a part of the inline line numbers implementation.

The patch was intended to be a minimal solution. A deeper integration of CodeRay would be awesome (eg. highlighting inside of .diffs, lines of code counter…), but currently I lack the time to do it myself :)

Updated by Kornelius Kalnbach at 2011-06-07 08:47 am

Holger Just wrote:

impressive

I guess you mean "unreadable"? ;) Sorry, I tend to code-golf sometimes. I can try to make it clearer.

Also available in: Atom PDF