Sha256: 3190a0e4766564a0b30a34a1be8385f63845b21a757691c80425e03480b657a0

Contents?: true

Size: 580 Bytes

Versions: 10

Compression:

Stored size: 580 Bytes

Contents

class BlueCloth

	def transform_code_blocks( str, rs )
		@log.debug " Transforming code blocks"

		str.gsub(CodeBlockRegexp) {|block|
			codeblock = $1
			remainder = $2

      # Generate the codeblock
      if codeblock =~ /^(?:[ ]{4}|\t)@@(.*?)\n\n(.*)\n\n/m
         "\n\n<pre class='highlight'>%s</pre>\n\n%s" %
          [CodeRay.scan(outdent($2), $1).html(:css => :class, :line_numbers => :list).delete("\n"), remainder]
      else
         "\n\n<pre><code>%s\n</code></pre>\n\n%s" %
          [encode_code(outdent(codeblock), rs).rstrip, remainder]
      end
		}
	end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
georgi-shinmun-0.3.1 lib/shinmun/bluecloth_coderay.rb
georgi-shinmun-0.3.2 lib/shinmun/bluecloth_coderay.rb
georgi-shinmun-0.3.3 lib/shinmun/bluecloth_coderay.rb
georgi-shinmun-0.3.4 lib/shinmun/bluecloth_coderay.rb
georgi-shinmun-0.3.5 lib/shinmun/bluecloth_coderay.rb
georgi-shinmun-0.3.6 lib/shinmun/bluecloth_coderay.rb
georgi-shinmun-0.3.7 lib/shinmun/bluecloth_coderay.rb
georgi-shinmun-0.3.8 lib/shinmun/bluecloth_coderay.rb
georgi-shinmun-0.3.9 lib/shinmun/bluecloth_coderay.rb
georgi-shinmun-0.3 lib/shinmun/bluecloth_coderay.rb