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.
This commit is contained in:
Mike West 2010-10-14 18:31:20 +02:00
parent 939e7f0e8a
commit 198be61e7c

View File

@ -176,7 +176,7 @@ class Rocco
# Do some post-processing on the pygments output to split things back # Do some post-processing on the pygments output to split things back
# into sections and remove partial `<pre>` blocks. # into sections and remove partial `<pre>` blocks.
code_html = code_html. 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?<div class="highlight"><pre>/m, '') }.
map { |code| code.sub(/\n?<\/pre><\/div>\n/m, '') } map { |code| code.sub(/\n?<\/pre><\/div>\n/m, '') }