Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No highlight for c# code #3

Open
sloncho opened this issue Feb 25, 2014 · 1 comment
Open

No highlight for c# code #3

sloncho opened this issue Feb 25, 2014 · 1 comment

Comments

@sloncho
Copy link

sloncho commented Feb 25, 2014

I was using an old code for the plugin. Now, after upgrading to redmine 2.4, and the latest code of the pygments plugin, the highlighting of c# repository files went away. I remember having this problem with the previous version as well, where I had to fix the html produced by pygments. I see the commit bab7ed9, where the html parsing is changed.

My old "fix" was like this:

      result = Pygments.highlight(text, :lexer => language, :formatter => 'html', :options => options)
      result.gsub!(/^<div class="highlight"><pre>/, '')
      result.gsub!(/<\/pre><\/div>/, '')
      result.gsub!(/^/m, '<span class="highlight">')
      result.gsub!(/$/m, '</span>')
      result.gsub!(/^<\/span>$/, '')
      result

I'm not a ruby dev, so I don't know how to do the same with the new stuff. But replacing the new stuff with this fixed the problem for me.

@simonswine
Copy link
Contributor

I just wrote a plugin for highlighting with highlight.js. if you want you can give it a try:
https://github.com/simonswine/redmine_highlightjs.git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants