code DIVIDER is now language-agnostic.

This commit is contained in:
Burke Libbey 2010-03-30 15:18:17 -05:00
parent 6595d5f885
commit 3dc4f87c12

View File

@ -164,7 +164,7 @@ class Rocco
# Combine all code blocks into a single big stream and run through either # Combine all code blocks into a single big stream and run through either
# `pygmentize(1)` or <http://pygments.appspot.com> # `pygmentize(1)` or <http://pygments.appspot.com>
code_stream = code_blocks.join("\n\n# DIVIDER\n\n") code_stream = code_blocks.join("\n\n#{@options[:comment_chars]} DIVIDER\n\n")
if (`which pygmentize` == "") if (`which pygmentize` == "")
code_html = highlight_webservice(code_stream) code_html = highlight_webservice(code_stream)
@ -175,7 +175,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."># 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, '') }