centralized pygments aliases into pygments_code.rb. Added alias for .ru (ruby), which sort of fixes #108
This commit is contained in:
@ -7,6 +7,10 @@ FileUtils.mkdir_p(PYGMENTS_CACHE_DIR)
|
||||
|
||||
module HighlightCode
|
||||
def highlight(str, lang)
|
||||
lang = 'ruby' if lang == 'ru'
|
||||
lang = 'objc' if lang == 'm'
|
||||
lang = 'perl' if lang == 'pl'
|
||||
lang = 'yaml' if lang == 'yml'
|
||||
str = pygments(str, lang).match(/<pre>(.+)<\/pre>/m)[1].to_s.gsub(/ *$/, '') #strip out divs <div class="highlight">
|
||||
tableize_code(str, lang)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user