Class: Markabb::Highlighters::Coderay

Inherits:
SyntaxHighlighter show all
Defined in:
lib/markabb/highlighters/coderay.rb

Overview

Markabb Syntax Highlighter for CodeRay

See http://coderay.rubychan.de/ for CodeRay

Instance Method Summary collapse

Methods inherited from SyntaxHighlighter

#initialize, #run

Constructor Details

This class inherits a constructor from Markabb::SyntaxHighlighter

Instance Method Details

#parse(lang, s) ⇒ Object

Takes the language and string as an option and passes config from Markabb for coderay

See coderay.rubychan.de/ for CodeRays configuration options



10
11
12
# File 'lib/markabb/highlighters/coderay.rb', line 10

def parse(lang, s)
    "[nobbc]" + ::CodeRay.scan(s, lang).div(Markabb.config.coderay_options) + "[/nobbc]"
end