Permalink
Browse files

Fixing code highlighting in bash mode

Rocco splits against `<span class="c.">`, which works fine for Ruby
where the `span` has a class of `c1`, but fails for Bash (and probably
other languages), where the `span` has a class of `c`.  The fix is
trivial.
  • Loading branch information...
1 parent 939e7f0 commit 198be61e7c07e2307bac49ada98967d41cf07045 @mikewest mikewest committed Oct 14, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/rocco.rb
View
@@ -176,7 +176,7 @@ def highlight(blocks)
# Do some post-processing on the pygments output to split things back
# into sections and remove partial `<pre>` blocks.
code_html = code_html.
- split(/\n*<span class="c.">#{@options[:comment_chars]} DIVIDER<\/span>\n*/m).
+ split(/\n*<span class="c.?">#{@options[:comment_chars]} DIVIDER<\/span>\n*/m).
map { |code| code.sub(/\n?<div class="highlight"><pre>/m, '') }.
map { |code| code.sub(/\n?<\/pre><\/div>\n/m, '') }

0 comments on commit 198be61

Please sign in to comment.