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

Ruby 1.9 compatibility for syntax highlighting #65

Closed
assaf opened this Issue Jun 30, 2009 · 3 comments

Comments

Projects
None yet
5 participants
@assaf
Copy link

assaf commented Jun 30, 2009

In jekyll/tags/highlight.rb, lines 24-30 attempt to join array into string by calling super.to_s (in two places). In Ruby 1.8 the call to to_s is the same as join, in 1.9 it's the same as inspect.

Fixed by changing to_s to join:

def render(context)
  if context.registers[:site].pygments
    render_pygments(context, super.join)
  else
    render_codehighlighter(context, super.join)
  end
end
@solson

This comment has been minimized.

Copy link

solson commented Dec 29, 2009

+1, I'm on Ruby 1.9.1 and the fix you described (changing to_s to join in those two places) fixed highlighting completely. :)

@beastaugh

This comment has been minimized.

Copy link

beastaugh commented Jan 12, 2010

This patch worked for me too. ruby -v output:

ruby 1.9.1p376 (2009-12-07 revision 26041) [i386-darwin10.2.0]
@mojombo

This comment has been minimized.

Copy link
Contributor

mojombo commented Jan 14, 2010

fix highlighting on ruby 1.9. closed by ba77a02

@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017

This issue was closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.